package com.aspose.cells;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;

class zaut {
   PivotTable a;
   Cells b;
   zaux c;
   zaux d;
   ArrayList e;
   int[][] f;
   private boolean[] x;
   int g = 0;
   int h = 0;
   private boolean y = false;
   private boolean[] z = null;
   private boolean[] A = null;
   private boolean B = false;
   private boolean C = false;
   boolean i;
   boolean j;
   boolean k;
   private int D = 1;
   boolean l = false;
   int m = 0;
   int n = 0;
   int o = 0;
   int p = 0;
   int q = 0;
   int r = 0;
   private ArrayList E;
   private ArrayList F;
   private ArrayList G;
   private ArrayList H;
   private ArrayList I;
   ArrayList s;
   ArrayList t;
   int[][] u;
   int[][] v;
   static boolean w = false;
   private static final com.aspose.cells.b.c.a.za J = new com.aspose.cells.b.c.a.za(new String[]{"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER", "JAN", "FEB", "MAR", "APR", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"});

   private void h() {
      this.o = this.a.getRowFields().getCount();
      this.p = this.a.getColumnFields().getCount();
      this.q = this.a.getDataFields().getCount();
      this.r = this.a.getPageFields().getCount();
      this.a.setPageFieldWrapCount(Math.min(this.r, this.a.getPageFieldWrapCount()));
      boolean var1;
      int var2;
      if (this.r > 0) {
         if (this.a.getPageFieldWrapCount() == 0) {
            this.a.setPageFieldWrapCount(this.r);
         }

         var1 = this.r % this.a.getPageFieldWrapCount() != 0;
         var2 = this.r / this.a.getPageFieldWrapCount();
         if (this.a.getPageFieldOrder() == 0) {
            this.a.q = var2 + (var1 ? 1 : 0);
            this.a.p = this.a.getPageFieldWrapCount();
         } else {
            this.a.p = var2 + (var1 ? 1 : 0);
            this.a.q = this.a.getPageFieldWrapCount();
         }
      }

      if (this.p == 0 && this.o == 0 && this.q == 0) {
         this.j = true;
         this.i = true;
      } else {
         this.k = true;
         if (this.q == 0 && !this.a.getDisplayImmediateItems()) {
            this.k = false;
         }

         if (this.a.getAutoFormatType() == 1) {
            this.i = true;
         } else if (this.p == 0) {
            this.i = true;
         } else if (this.p == 1) {
            if (this.q > 1 && this.a.getDataField() == this.a.getColumnFields().get(0)) {
               this.i = false;
            } else {
               this.i = true;
            }
         } else {
            this.i = true;
         }

         if (this.a.f != null) {
            this.g = this.a.f.m;
            this.h = this.a.f.getPosition();
         }

         int var6;
         if (this.a.d.v != null && this.a.d.v.getCount() != 0) {
            var1 = true;

            PivotField var3;
            int var4;
            PivotItem var5;
            for(var2 = 0; var2 < this.o; ++var2) {
               var3 = this.a.getRowFields().get(var2);
               var6 = var3.getPivotItems().getCount();

               for(var4 = 0; var4 < var6; ++var4) {
                  var5 = var3.getPivotItems().get(var4);
                  if (var5.b()) {
                     this.B = true;
                     break;
                  }
               }

               if (this.B) {
                  break;
               }
            }

            for(var2 = 0; var2 < this.p; ++var2) {
               var3 = this.a.getColumnFields().get(var2);
               var6 = var3.getPivotItems().getCount();

               for(var4 = 0; var4 < var6; ++var4) {
                  var5 = var3.getPivotItems().get(var4);
                  if (var5.b()) {
                     this.C = true;
                     break;
                  }
               }

               if (this.C) {
                  break;
               }
            }

            this.y = true;
         }

         for(var6 = 0; var6 < this.o; ++var6) {
            PivotField var7 = this.a.getRowFields().get(var6);
            if (((!var7.getShowInOutlineForm() || !var7.getShowCompact()) && !var7.i() || var7.i() && (!this.a.v || !this.a.x)) && var6 != this.o - 1) {
               ++this.D;
            }
         }

         if (!this.a.isGridDropZones() && this.o == 0 && this.a.a.b.getWorkbook().getFileFormat() != 5 && this.D == 1 && this.q == 0) {
            this.D = 0;
         }

      }
   }

   zaut(PivotTable var1) {
      this.a = var1;
      this.b = var1.a.b.getCells();
      this.h();
   }

   void a(Style var1) {
      zauy var2 = new zauy(this);
      var2.a(var1);
   }

   void a(int var1, int var2, Style var3) {
      zauy var4 = new zauy(this);
      var4.a(var1, var2, var3);
   }

   void a(Chart var1, String var2) {
      if (this.a.d.n != null) {
         this.f = this.a(-1);
         this.f();
         this.g();
         this.d();
         this.e();
         this.b(var1, var2);
      }
   }

   private ArrayList a(String[] var1) {
      var1[0] = "";
      new StringBuilder();
      new StringBuilder();
      ArrayList var4 = new ArrayList();
      ArrayList var5 = new ArrayList();
      Object var6 = null;

      StringBuilder var3;
      int var7;
      for(var7 = 0; var7 < this.a.g.size(); ++var7) {
         if (var4.size() > 0) {
            var3 = new StringBuilder();
            if (var4.size() == 1) {
               com.aspose.cells.b.a.a.ze.a(var5, var4.get(0));
            } else {
               for(int var8 = var4.size() - 1; var8 > 0; --var8) {
                  var3.append(var4.get(var8));
                  var3.append("\n");
               }

               var3.append(var4.get(0));
               com.aspose.cells.b.a.a.ze.a(var5, (Object)com.aspose.cells.b.a.zr.a(var3));
            }

            var4 = new ArrayList();
         }

         zbrd var14 = new zbrd((int[])((int[])this.a.g.get(var7)));
         if (!var14.c() && !var14.d() && var14.c != 13) {
            for(int var9 = var14.b; var9 < var14.e; ++var9) {
               int var10 = var14.f[var9];
               PivotItem var11 = this.a.getRowFields().get(var9).getPivotItems().get(var10);
               if (this.a.getDataField() != null && this.h >= 0 && var9 == this.h) {
                  int var12 = var14.f();
                  if (var12 < this.q) {
                     if ("".equals(var1[0])) {
                        if (!"".equals(this.a.getDataFields().get(var12).getNumberFormat()) && this.a.getDataFields().get(var12).getNumberFormat() != null) {
                           var1[0] = this.a.getDataFields().get(var12).getNumberFormat();
                        } else if (this.a.getDataFields().get(var12).getNumber() != 0) {
                           var1[0] = this.a.a.b.getWorkbook().getSettings().e().d(this.a.getDataFields().get(var12).getNumber());
                        }
                     }

                     String var13 = this.a.getDataFields().get(var12).getDisplayName();
                     if (null == var13) {
                        com.aspose.cells.b.a.a.ze.a(var4, (Object)"(blank)");
                     } else {
                        com.aspose.cells.b.a.a.ze.a(var4, (Object)var13);
                     }
                  }
               } else {
                  if ("".equals(var1[0])) {
                     if (!"".equals(this.a.getRowFields().get(var9).getNumberFormat()) && this.a.getRowFields().get(var9).getNumberFormat() != null) {
                        var1[0] = this.a.getRowFields().get(var9).getNumberFormat();
                     } else if (this.a.getRowFields().get(var9).getNumber() != 0) {
                        var1[0] = this.a.a.b.getWorkbook().getSettings().e().d(this.a.getRowFields().get(var9).getNumber());
                     }
                  }

                  var6 = var11.getValue();
                  if (null == var6) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)"(blank)");
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var4, var6);
                  }
               }
            }
         }
      }

      if (var5.size() < this.a.g.size() && var4.size() > 0) {
         var3 = new StringBuilder();
         if (var4.size() == 1) {
            com.aspose.cells.b.a.a.ze.a(var5, var4.get(0));
         } else {
            for(var7 = var4.size() - 1; var7 > 0; --var7) {
               var3.append(var4.get(var7));
               var3.append("\n");
            }

            var3.append(var4.get(0));
            com.aspose.cells.b.a.a.ze.a(var5, (Object)com.aspose.cells.b.a.zr.a(var3));
         }
      }

      return var5;
   }

   void b(Chart var1, String var2) {
      CellArea var3;
      CellArea var4;
      ArrayList var6;
      if (this.p == 0 || this.o == 0) {
         if (this.q == 0) {
            var1.getNSeries().clear();
            return;
         }

         String var26;
         if (this.p == 0 && this.o == 0) {
            if (var1.getNSeries().getCount() > 1) {
               var1.getNSeries().a(1, var1.getNSeries().getCount() - 1);
            }

            var3 = null;
            var4 = this.a.getDataBodyRange();
            var26 = this.a(true, var2, var4.StartRow, var4.StartColumn, var4.EndRow, var4.EndColumn);
            Series var25;
            if (var1.getNSeries().getCount() < 1) {
               var1.getNSeries().add(var26, true);
               var25 = var1.getNSeries().get(0);
            } else {
               var25 = var1.getNSeries().get(0);
               var25.setValues(var26);
            }

            var25.setXValues(this.a(true, var2, var4.StartRow - 1, var4.StartColumn, var4.StartRow - 1, var4.EndColumn));
            var25.setName("Total");
            return;
         }

         if (this.p == 0) {
            if (var1.getNSeries().getCount() > 1) {
               var1.getNSeries().a(1, var1.getNSeries().getCount() - 1);
            }

            var3 = this.a.getDataBodyRange();
            var4 = this.a.getRowRange();
            var26 = this.a(true, var2, var3.StartRow, var3.StartColumn, var3.EndRow, var3.EndColumn);
            var6 = null;
            Series var27;
            if (var1.getNSeries().getCount() < 1) {
               var1.getNSeries().add(var26, true);
               var27 = var1.getNSeries().get(0);
            } else {
               var27 = var1.getNSeries().get(0);
               var27.setValues(var26);
            }

            var27.setXValues(this.a(true, var2, var3.StartRow, var4.StartColumn, var3.EndRow, var4.EndColumn));
            var27.setName("Total");
            String var28 = null;
            String[] var29 = new String[]{var28};
            var27.m().a(this.a(var29));
            var28 = var29[0];
            var27.m().a(var28);
            ArrayList var9 = new ArrayList();

            for(int var30 = 0; var30 < this.H.size(); ++var30) {
               zbrd var31 = (zbrd)this.H.get(var30);
               if (var31.c != 14 && var31.e == this.o && var31.c != 13) {
                  PivotField var32 = this.a((zbrd)var31, (zbrd)null);
                  if ("".equals(var27.l().e()) || var27.l().e() == null) {
                     var27.l().a(var32.getNumberFormat());
                  }

                  ArrayList var33 = this.b(var31.d, var31, this.g == 1, this.a.getRowFields());
                  if (var32 != null) {
                     this.m = var30;
                     Object var34 = this.a((PivotItem)null, (PivotItem)null, var33, true, var32, 0, (zbrd)null);
                     var34 = this.a(var34);
                     com.aspose.cells.b.a.a.ze.a(var9, var34);
                  }
               }
            }

            var27.l().a(var9);
            return;
         }
      }

      var3 = this.a.getRowRange();
      var4 = this.a.getDataBodyRange();
      CellArea var5 = this.a.getColumnRange();
      var6 = this.a.h;
      int var7 = 0;
      int var8 = var5.StartColumn;
      new ArrayList();
      new ArrayList();

      while(var1.getNSeries().getCount() > var6.size()) {
         var1.getNSeries().removeAt(var1.getNSeries().getCount() - 1);
      }

      for(int var11 = 0; var11 < var6.size(); ++var11) {
         ArrayList var10 = new ArrayList();
         int[] var12 = (int[])((int[])var6.get(var11));
         zbrd var13 = new zbrd(var12);
         if (var12[2] > 0 && var12[1] == 0) {
            Series var14 = null;
            String var15 = this.a(true, var2, var4.StartRow, var4.StartColumn + var11, var4.EndRow, var4.StartColumn + var11);
            if (var7 >= var1.getNSeries().getCount()) {
               var1.getNSeries().add(var15, true);
               var14 = var1.getNSeries().get(var7);
            } else {
               var14 = var1.getNSeries().get(var7);
               var14.setValues(var15);
            }

            if (this.o != 0 && (this.p != 1 || this.a.getColumnFields().get(0).t != -2)) {
               var14.setXValues(this.a(true, var2, var3.StartRow + 1, var3.StartColumn, var3.EndRow, var3.EndColumn));
            } else {
               var14.setXValues(this.a(true, var2, var3.StartRow, var3.StartColumn, var3.EndRow, var3.EndColumn));
            }

            var14.setName(this.a(true, var2, var5.StartRow, var5.StartColumn + var11, var5.EndRow, var5.StartColumn + var11));
            StringBuilder var16 = new StringBuilder();

            for(int var17 = 0; var17 < var13.e; ++var17) {
               int var18 = var13.f[var17];
               PivotItem var19 = this.a.getColumnFields().get(var17).getPivotItems().get(var18);
               if (var19.getValue() != null) {
                  var16.append(com.aspose.cells.b.a.zr.a(var19.getValue()));
                  if (var13.e > 0 && var17 != var13.e - 1) {
                     var16.append(" - ");
                  }
               } else if (var19.e != null && var19.e.t < this.q) {
                  var16.append(this.a.getDataFields().get(var19.e.t).getDisplayName());
               }
            }

            var14.b = com.aspose.cells.b.a.zr.a(var16);
            String var35 = null;
            String[] var36 = new String[]{var35};
            var14.m().a(this.a(var36));
            var35 = var36[0];
            var14.m().a(var35);
            if (this.H != null) {
               for(int var37 = 0; var37 < this.H.size(); ++var37) {
                  zbrd var20 = (zbrd)this.H.get(var37);
                  if (var20.c != 14 && var20.e == this.o && var20.c != 13) {
                     zbrd var21 = (zbrd)this.I.get(var11);
                     PivotField var22 = this.a(var20, var21);
                     if ("".equals(var14.l().e()) || var14.l().e() == null) {
                        var14.l().a(var22.getNumberFormat());
                     }

                     ArrayList var23 = this.b(var20.d, var21, this.g == 2, this.a.getColumnFields());
                     if (var22 != null) {
                        this.m = var37;
                        this.n = var11;
                        Object var24 = this.a((PivotItem)null, (PivotItem)null, var23, true, var22, var11, var21);
                        var24 = this.a(var24);
                        com.aspose.cells.b.a.a.ze.a(var10, var24);
                     }
                  }
               }
            }

            var14.l().a(var10);
            ++var7;
         }
      }

   }

   private String a(boolean var1, String var2, int var3, int var4, int var5, int var6) {
      StringBuilder var7 = new StringBuilder();
      var7.append('=');
      var7.append(var2);
      var7.append('!');
      var7.append(CellsHelper.cellIndexToName(var3, var4));
      if (var1) {
         var7.append(':');
         var7.append(CellsHelper.cellIndexToName(var5, var6));
      }

      return com.aspose.cells.b.a.zr.a(var7);
   }

   private void i() {
      Cell var1 = null;
      Style var2 = new Style(this.a.a.b.c());
      var2.setBorder(1, 1, Color.getBlack());

      for(int var3 = this.a.i + 1; var3 < this.a.j; ++var3) {
         var1 = this.a.a.b.getCells().a(var3, this.a.k, false);
         var1.a(var2);
      }

      Style var7 = new Style(this.a.a.b.c());
      var7.setBorder(2, 1, Color.getBlack());

      for(int var4 = this.a.i + 1; var4 < this.a.j; ++var4) {
         var1 = this.a.a.b.getCells().a(var4, this.a.l, false);
         var1.a(var7);
      }

      Style var8 = new Style(this.a.a.b.c());
      var8.setBorder(4, 1, Color.getBlack());

      for(int var5 = this.a.k + 1; var5 < this.a.l; ++var5) {
         var1 = this.a.a.b.getCells().a(this.a.i, var5, false);
         var1.a(var8);
      }

      Style var9 = new Style(this.a.a.b.c());
      var9.setBorder(8, 1, Color.getBlack());

      for(int var6 = this.a.k + 1; var6 < this.a.l; ++var6) {
         var1 = this.a.a.b.getCells().a(this.a.j, var6, false);
         var1.a(var9);
      }

      var1 = this.a.a.b.getCells().a(this.a.i, this.a.k, false);
      Style var10 = new Style(this.a.a.b.c());
      var10.setBorder(1, 1, Color.getBlack());
      var10.setBorder(4, 1, Color.getBlack());
      var1.a(var10);
      var1 = this.a.a.b.getCells().a(this.a.i, this.a.l, false);
      var10 = new Style(this.a.a.b.c());
      var10.setBorder(2, 1, Color.getBlack());
      var10.setBorder(4, 1, Color.getBlack());
      var1.a(var10);
      var1 = this.a.a.b.getCells().a(this.a.j, this.a.k, false);
      var10 = new Style(this.a.a.b.c());
      var10.setBorder(1, 1, Color.getBlack());
      var10.setBorder(8, 1, Color.getBlack());
      var1.a(var10);
      var1 = this.a.a.b.getCells().a(this.a.j, this.a.l, false);
      var10 = new Style(this.a.a.b.c());
      var10.setBorder(2, 1, Color.getBlack());
      var10.setBorder(8, 1, Color.getBlack());
      var1.a(var10);
   }

   void a() throws Exception {
      if (this.a.d.n != null && this.a.d.n.a != null) {
         this.o();
         this.j();
         this.f = this.a(-1);
         this.f();
         this.g();
         this.d();
         this.e();
         if (!this.j) {
            zauy var1 = new zauy(this);
            var1.b();
            var1.d();
            this.m();
            this.k();
            var1.f();
            var1.e();
            this.a.ah = true;
         } else {
            this.i();
         }

         if (this.a.isAutoFormat()) {
            Worksheet var3 = this.a.a.b;
            AutoFitterOptions var2 = new AutoFitterOptions();
            var2.setIgnoreHidden(true);
            var3.autoFitColumns(this.a.i, this.a.k, this.a.j, this.a.l, var2);
         }

      }
   }

   void b() {
      if (this.a.d.n != null) {
         this.f = this.a(-1);
         this.f();
         this.g();
         this.d();
         this.e();
      }
   }

   private void j() {
      this.a.ad = (int[][])null;
      this.a.ae = (int[][])null;
      this.a.ac = null;
      int var1 = this.a.a.b.c().B().c(new Style(this.a.a.b.c()));

      int var3;
      Cell var4;
      for(int var2 = this.a.i; var2 <= this.a.j; ++var2) {
         for(var3 = this.a.k; var3 <= this.a.l; ++var3) {
            var4 = this.a.a.b.getCells().a(var2, var3, false);
            if (var4 != null) {
               var4.b(var1);
            }
         }
      }

      if (this.r > 0) {
         CellArea var7 = this.n();
         var3 = 0;
         var4 = null;
         int var5;
         int var6;
         if (this.a.getPageFieldOrder() == 0) {
            for(var5 = var7.StartColumn; var5 <= var7.EndColumn && var3 < this.r; var5 += 3) {
               for(var6 = var7.StartRow; var6 <= var7.EndRow && var3 < this.r; ++var6) {
                  var4 = this.a.a.b.getCells().a(var6, var5, false);
                  if (var4 != null) {
                     var4.b(var1);
                  }

                  var4 = this.a.a.b.getCells().a(var6, var5 + 1, false);
                  if (var4 != null) {
                     var4.b(var1);
                  }

                  ++var3;
               }
            }
         } else {
            for(var5 = var7.StartRow; var5 <= var7.EndRow && var3 < this.r; ++var5) {
               for(var6 = var7.StartColumn; var6 <= var7.EndColumn && var3 < this.r; var6 += 3) {
                  var4 = this.a.a.b.getCells().a(var5, var6, false);
                  if (var4 != null) {
                     var4.b(var1);
                  }

                  var4 = this.a.a.b.getCells().a(var5, var6 + 1, false);
                  if (var4 != null) {
                     var4.b(var1);
                  }

                  ++var3;
               }
            }
         }
      }

   }

   void c() {
      if (this.a.d != null && this.a.d.n != null) {
         try {
            this.j();
            this.f = this.l();
            if (this.a.d.n.b == null) {
               this.a.refreshData();
            }

            this.f();
            this.g();
            if (!this.j) {
               zauy var1 = new zauy(this);
               var1.b();
               var1.d();
               var1.c();
               this.d();
               var1.a();
               var1.f();
               var1.e();
               this.a.ah = true;
            } else {
               this.j();
               this.i();
            }
         } catch (Exception var2) {
            this.a.ae = (int[][])null;
            this.a.ad = (int[][])null;
            this.a.ac = null;
         }

      }
   }

   private void a(PivotField var1, int var2, Cell var3, boolean var4, boolean var5) {
      if (!this.a.D) {
         this.a(var3);
      } else {
         if (var2 == 0) {
            if (!var1.getShowCompact() && !this.a.v) {
               if (var1.getDisplayName() != null && var1.getDisplayName().length() > 0) {
                  var3.putValue(var1.getDisplayName());
               } else {
                  var3.putValue(var1.getName());
               }
            } else if (this.a.getRowHeaderCaption() != null) {
               var3.putValue(this.a.getRowHeaderCaption());
            } else {
               var3.putValue("Row Labels");
            }
         } else if (var1.getDisplayName() != null && var1.getDisplayName().length() > 0) {
            var3.putValue(var1.getDisplayName());
         } else {
            var3.putValue(var1.getName());
         }

         this.a(var3);
      }
   }

   private void k() {
      if (!this.j) {
         Cell var1 = null;
         int var2 = this.a.i;
         int var3 = this.a.k;
         int var4 = this.a.o;
         int var5 = this.a.m;
         int var6 = this.a.n;
         int var10;
         if (this.i) {
            int var7;
            int var8;
            if (this.q == 1) {
               var7 = this.p == 0 && !this.a.isGridDropZones() ? var4 : var3;
               Cell var21 = this.b.a(var2, var7, false);
               var21.putValue(this.a.getDataFields().get(0).getDisplayName());
               this.a(var21);

               for(int var9 = var2; var9 < var6; ++var9) {
                  for(var10 = var3; var10 < var4; ++var10) {
                     if (var9 != var2 || var10 != var7) {
                        var1 = this.b.a(var9, var10, false);
                        this.a(var1);
                     }
                  }
               }
            } else {
               for(var7 = var2; var7 < var6; ++var7) {
                  for(var8 = var3; var8 < var4; ++var8) {
                     var1 = this.b.a(var7, var8, false);
                     this.a(var1);
                  }
               }
            }

            if (this.p != 0) {
               if (this.a.D) {
                  for(var8 = 0; var8 < this.p; ++var8) {
                     if (var8 > 0 && this.a.getColumnFields().get(var8 - 1).getShowCompact() && this.a.getColumnFields().get(var8 - 1).getShowInOutlineForm()) {
                        var1 = this.b.a(var2, var4 + var8, false);
                        this.a(var1);
                     } else {
                        String var22 = this.a.getColumnFields().get(var8).getDisplayName();
                        var1 = this.b.a(var2, var4 + var8, false);
                        if (var4 + var8 <= this.a.l) {
                           if (var8 == 0) {
                              if (this.a.v) {
                                 if (this.a.getColumnHeaderCaption() != null) {
                                    var1.putValue(this.a.getColumnHeaderCaption());
                                 } else {
                                    var1.putValue("Column Labels");
                                 }
                              } else if (var22 != null && var22.length() > 0) {
                                 var1.putValue(var22);
                              } else {
                                 var1.putValue(this.a.getColumnFields().get(var8).getName());
                              }
                           } else if (!this.a.v) {
                              if (var22 != null && var22.length() > 0) {
                                 var1.putValue(var22);
                              } else {
                                 var1.putValue(this.a.getColumnFields().get(var8).getName());
                              }
                           }

                           this.a(var1);
                        }
                     }
                  }

                  if (var4 + this.p <= this.a.l) {
                     for(var8 = var4 + this.p; var8 <= this.a.l; ++var8) {
                        var1 = this.b.a(var2, var8, false);
                        this.a(var1);
                     }
                  }

                  if (this.k) {
                     if (!this.a.isGridDropZones() && this.p == 1 && this.a.getColumnFields().get(0).c() < 0 && this.a.J) {
                        this.b(var2, var4);
                     } else {
                        this.b(var2 + 1, var4);
                     }
                  }
               } else if (this.k) {
                  if (!this.a.isGridDropZones() && (this.q != 1 || this.p <= 0)) {
                     this.b(var2, var4);
                  } else {
                     this.b(var2 + 1, var4);
                  }
               }
            } else if (this.k && this.q != 0) {
               if (this.a.getDataField() == null) {
                  if (this.H != null && this.H.size() != 0 && var2 + 1 < this.a.n) {
                     var1 = this.b.a(var2 + 1, var4, false);
                     var1.putValue("Total");
                     this.a(var1);
                  }
               } else if (this.H != null && this.H.size() != 0) {
                  var1 = this.b.a(var2, var4, false);
                  var1.putValue("Total");
                  this.a(var1);
               }
            }
         } else if (this.k) {
            this.b(var2, var4);
         }

         if (this.o != 0) {
            boolean var24 = this.a.getRowFields().get(0).getShowCompact();
            boolean var23 = this.a.getRowFields().get(0).getShowInOutlineForm();
            boolean var25 = false;
            int var11 = 0;
            if (this.a.getDataField() == null && this.a.isGridDropZones()) {
               var10 = var2 + 1;
            } else {
               var10 = var2;
            }

            int var12;
            for(var12 = 0; var12 < this.o; ++var12) {
               PivotField var13 = this.a.getRowFields().get(var12);
               if (var24 && var12 > 0 && var23) {
                  var1 = this.b.a(var2, var3 + var12 - var11, false);
                  this.a(var1);
                  var24 = this.a.getRowFields().get(var12).getShowCompact();
                  var23 = this.a.getRowFields().get(var12).getShowInOutlineForm();
                  ++var11;
               } else {
                  if (this.p != 0) {
                     if (this.a.getShowRowHeaderCaption()) {
                        if (this.p == 1 && this.a.getColumnFields().get(0).t == -2 && this.a.J && !this.a.isGridDropZones()) {
                           var1 = this.b.a(var2, var3 + var12 - var11, false);
                           this.a(var13, var12, var1, var24, var23);
                        } else {
                           var1 = this.b.a(var2 + 1 + this.p - 1, var3 + var12 - var11, false);
                           this.a(var13, var12, var1, var24, var23);
                        }
                     }
                  } else {
                     var1 = this.b.a(var10, var3 + var12 - var11, false);
                     this.a(var13, var12, var1, var24, var23);
                  }

                  var24 = this.a.getRowFields().get(var12).getShowCompact();
                  var23 = this.a.getRowFields().get(var12).getShowInOutlineForm();
               }
            }

            if (this.k) {
               this.a(var6, var3);
            }

            int var26;
            if (this.y & this.B) {
               var12 = this.H.size();

               zbrd var14;
               for(var26 = 0; var26 < var12; ++var26) {
                  var14 = (zbrd)this.H.get(var26);
                  if (var14.c != 14 && !var14.g() && !var14.d()) {
                     this.a(var14, this.a.getRowFields());
                     if (var14.c()) {
                        ;
                     }
                  }
               }

               for(var26 = 0; var26 < var12; ++var26) {
                  var14 = (zbrd)this.H.get(var26);
                  if (!var14.d() && var14.c()) {
                     ;
                  }
               }
            } else {
               var12 = this.H.size();
               var26 = this.I != null ? this.I.size() : 0;

               for(int var27 = 0; var27 < var12; ++var27) {
                  zbrd var15 = (zbrd)this.H.get(var27);
                  boolean var16 = var15.c == 14;
                  boolean var17 = var15.b < this.o - 1 && this.a.getRowFields().get(var15.b).k() && this.a.getRowFields().get(var15.b).getShowInOutlineForm() && var15.c != 13;
                  boolean var18 = var15.c != 13 && var15.e() && !var15.c() && (this.a.getDataField().getPosition() < this.o - 1 && var15.e - 1 <= this.a.getDataField().getPosition() || this.a.getDataField().getPosition() == this.o - 1 && var15.e <= this.a.getDataField().getPosition());
                  if (!var16 && !var17 && !var18) {
                     this.b(var6 + var27, var4, var15, var15.d);
                  } else {
                     Cell var19 = null;

                     for(int var20 = 0; var20 < var26; ++var20) {
                        var19 = this.b.a(var6 + var27, var4 + var20, false);
                        this.a(var19);
                     }
                  }
               }
            }
         } else if (this.k && this.q != 0) {
            var1 = this.b.a(var6, var3, false);
            var1.putValue("Total");
            this.a(var1);
            if (this.C) {
               this.a(var6, var4, (zbrd)null, this.e);
            } else {
               this.b(var6, var4, (zbrd)null, this.e);
            }
         }

      }
   }

   private Object a(PivotItem var1) {
      if (var1.getValue() == null) {
         return var1.getName() != null && var1.getName().length() > 0 ? var1.getName() : "(blank)";
      } else {
         return var1.getValue() instanceof DateTime ? (DateTime)var1.getValue() : var1.getValue();
      }
   }

   private int a(PivotFieldCollection var1, int var2) {
      int var3 = 0;

      for(int var4 = 0; var4 < var2; ++var4) {
         PivotField var5 = var1.get(var4);
         if (var5.getShowCompact() && var5.getShowInOutlineForm() || var5.i() && this.a.x && this.a.v) {
            ++var3;
         }
      }

      return var3;
   }

   private void a(int var1, int var2) {
      Cell var3 = null;
      int var4 = this.H.size();

      for(int var5 = 0; var5 < var4; ++var5) {
         zbrd var6 = (zbrd)this.H.get(var5);
         int var7;
         if (var6.b > 0) {
            for(var7 = 0; var7 < var6.b; ++var7) {
               PivotField var8 = this.a.getRowFields().get(var7);
               if (var8.q && var1 + var5 - 1 >= 0) {
                  this.b.a(var1 + var5, var2 + var7, false).copy(this.b.a(var1 + var5 - 1, var2 + var7, false));
               }
            }
         }

         if (var6.c == 14) {
            for(var7 = this.a.k; var7 < this.a.o; ++var7) {
               var3 = this.b.a(var1 + var5, var7, false);
               this.a(var3);
            }
         } else {
            var7 = var6.b;
            int var9;
            int var12;
            int var13;
            Style var14;
            int var15;
            Object var16;
            int var17;
            int var18;
            PivotItem var19;
            Style var20;
            if (var6.e()) {
               if (var6.c()) {
                  if (var6.b > 0) {
                     for(var15 = 0; var15 < var6.b; ++var15) {
                        if (var15 + var2 < this.a.o) {
                           var3 = this.b.a(var1 + var5, var15 + var2, false);
                           this.a(var3);
                        }
                     }
                  }

                  var19 = this.a.getRowFields().get(var7).getPivotItems().get(var6.f[var7]);
                  var16 = this.a(var19);
                  var17 = this.a(this.a.getRowFields(), var7);
                  var18 = var2 + var7 - var17;
                  var3 = this.b.a(var1 + var5, var18, false);
                  if (var3 != null) {
                     var20 = this.a(this.a.getRowFields().get(var7), var19);
                     if (var16 instanceof DateTime || !var20.getCustom().equals("") || var20.getNumber() != 0) {
                        var3.putValue(var16);
                        var3.setStyle(var20);
                        var16 = var3.getStringValue();
                     }

                     if (var6.b < this.h) {
                        var13 = var6.f();
                        var3.putValue(var16 + " " + this.a.getDataFields().get(var13).getDisplayName());
                     } else {
                        var3.putValue(var16 + var6.b());
                     }

                     this.a(var3);
                  }

                  if (var2 + var7 + 1 < this.a.o) {
                     for(var12 = var2 + var7 + 1; var12 < this.a.o; ++var12) {
                        var3 = this.b.a(var1 + var5, var12, false);
                        this.a(var3);
                     }
                  }
               } else if (var6.d()) {
                  if (this.q == 1) {
                     var3 = this.b.a(var1 + var5, var2, false);
                     var3.putValue(this.a.getGrandTotalName());
                  } else {
                     var15 = var6.a();
                     var3 = this.b.a(var1 + var5, var2, false);
                     var3.putValue("Total " + this.a.getDataFields().get(var15).getDisplayName());
                  }

                  this.a(var3);
                  if (var2 + 1 < this.a.o) {
                     for(var15 = var2 + 1; var15 < this.a.o; ++var15) {
                        var3 = this.b.a(var1 + var5, var15, false);
                        this.a(var3);
                     }
                  }
               } else {
                  if (var6.b > 0) {
                     for(var15 = 0; var15 < var6.b; ++var15) {
                        if (var15 + var2 < this.a.o) {
                           var3 = this.b.a(var1 + var5, var15 + var2, false);
                           this.a(var3);
                        }
                     }
                  }

                  if (var6.e + var2 < this.a.o) {
                     for(var15 = var6.e + var2; var15 < this.a.o; ++var15) {
                        var3 = this.b.a(var1 + var5, var15, false);
                        this.a(var3);
                     }
                  }

                  for(var15 = var6.b; var15 < var6.e; ++var15) {
                     var9 = this.a(this.a.getRowFields(), var15);
                     var17 = var2 + var15 - var9;
                     if (var15 == this.h) {
                        var18 = var6.f();
                        if (var18 < this.q) {
                           var3 = this.b.a(var1 + var5, var17, false);
                           var3.putValue(this.a.getDataFields().get(var18).getDisplayName());
                           this.a(var3);
                        }
                     } else {
                        var18 = var6.f[var15];
                        PivotItem var21 = this.a.getRowFields().get(var15).getPivotItems().get(var18);
                        Object var22 = this.a(var21);
                        var3 = this.b.a(var1 + var5, var17, false);
                        if (var3 != null) {
                           var3.putValue(var22);
                           var14 = this.a(this.a.getRowFields().get(var15), var21);
                           if (var22 instanceof DateTime || !var14.getCustom().equals("") || var14.getNumber() != 0) {
                              var3.setStyle(var14);
                           }

                           this.a(var3);
                        }
                     }
                  }
               }
            } else if (var6.c()) {
               if (var6.b > 0) {
                  for(var15 = 0; var15 < var6.b; ++var15) {
                     if (var15 + var2 < this.a.o) {
                        var3 = this.b.a(var1 + var5, var15 + var2, false);
                        this.a(var3);
                     }
                  }
               }

               var19 = this.a.getRowFields().get(var7).getPivotItems().get(var6.f[var7]);
               var16 = this.a(var19);
               var17 = this.a(this.a.getRowFields(), var7);
               var18 = var2 + var7 - var17;
               var3 = this.b.a(var1 + var5, var18, false);
               if (var3 != null) {
                  var20 = this.a(this.a.getRowFields().get(var7), var19);
                  if (var16 instanceof DateTime || !var20.getCustom().equals("") || var20.getNumber() != 0) {
                     var3.putValue(var16);
                     var3.a(var20);
                     var16 = var3.getStringValue();
                  }

                  var3.putValue(var16 + var6.b());
                  this.a(var3);
               }

               if (var2 + var7 + 1 < this.a.o) {
                  for(var12 = var2 + var7 + 1; var12 < this.a.o; ++var12) {
                     var3 = this.b.a(var1 + var5, var12, false);
                     this.a(var3);
                  }
               }
            } else if (var6.d()) {
               if (var6.b > 0) {
                  for(var15 = 0; var15 < var6.b; ++var15) {
                     if (var15 + var2 < this.a.o) {
                        var3 = this.b.a(var1 + var5, var15 + var2, false);
                        this.a(var3);
                     }
                  }
               }

               var3 = this.b.a(var1 + var5, var2 + var7, false);
               if (this.a.e != null && this.a.e.b != null) {
                  var3.putValue(this.a.e.b);
               } else {
                  var3.putValue(this.a.getGrandTotalName());
               }

               this.a(var3);
               if (var2 + var7 + 1 < this.a.o) {
                  for(var15 = var2 + var7 + 1; var15 < this.a.o; ++var15) {
                     var3 = this.b.a(var1 + var5, var15, false);
                     this.a(var3);
                  }
               }
            } else {
               if (var6.b > 0) {
                  for(var15 = 0; var15 < var6.b; ++var15) {
                     if (var15 + var2 < this.a.o) {
                        var3 = this.b.a(var1 + var5, var15 + var2, false);
                        this.a(var3);
                     }
                  }
               }

               if (var6.e + var2 < this.a.o) {
                  for(var15 = var6.e + var2; var15 < this.a.o; ++var15) {
                     var3 = this.b.a(var1 + var5, var15, false);
                     this.a(var3);
                  }
               }

               for(var15 = var6.b; var15 < var6.e; ++var15) {
                  var9 = var6.f[var15];
                  PivotItem var10 = this.a.getRowFields().get(var15).getPivotItems().get(var9);
                  Object var11 = this.a(var10);
                  var12 = this.a(this.a.getRowFields(), var15);
                  var13 = var2 + var15 - var12;
                  if (var15 > 0 && this.a.getRowFields().get(var15 - 1).getShowInOutlineForm() && this.a.getRowFields().get(var15 - 1).getShowCompact()) {
                     var3 = this.b.a(var1 + var5, var13, false);
                     var3.putValue(var11);
                  } else {
                     var3 = this.b.a(var1 + var5, var13, false);
                     var3.putValue(var11);
                  }

                  var14 = this.a(this.a.getRowFields().get(var15), var10);
                  if ((var11 instanceof DateTime || !var14.getCustom().equals("") || var14.getNumber() != 0) && var3 != null) {
                     var3.setStyle(var14);
                  }

                  this.a(var3);
               }
            }
         }
      }

   }

   private Style a(PivotField var1, PivotItem var2) {
      Style var3 = new Style();
      short var4 = var1.c.d;
      String var5 = var1.c.e;
      if ("".equals(var5)) {
         if (var4 != 0) {
            var3.setNumber(var4);
         } else if ("".equals(var1.getNumberFormat())) {
            var5 = this.a.a.b.getWorkbook().getWorksheets().h(var2.d().q);
            if ("".equals(var5)) {
               var3.setNumber(var2.d().q);
            } else {
               var3.setCustom(var5);
            }
         } else {
            var3.setCustom(var1.getNumberFormat());
         }
      } else {
         var3.setCustom(var5);
      }

      return var3;
   }

   private void b(int var1, int var2) {
      Cell var3;
      int var4;
      if (!this.i) {
         var3 = null;
         if (this.q == 0) {
            var3 = this.b.a(var1, var2, false);
            var3.putValue("Total");
            this.a(var3);
         } else {
            for(var4 = 0; var4 < this.q; ++var4) {
               var3 = this.b.a(var1, var2 + var4, false);
               var3.putValue(this.a.getDataFields().get(var4).getDisplayName());
               this.a(var3);
            }
         }

      } else {
         var3 = null;
         var4 = this.I.size();

         for(int var5 = 0; var5 < var4; ++var5) {
            zbrd var6 = (zbrd)this.I.get(var5);
            int var7;
            if (var6.b > 0) {
               for(var7 = 0; var7 < var6.b; ++var7) {
                  PivotField var8 = this.a.getColumnFields().get(var7);
                  if (var8.q && var2 + var5 - 1 >= 0) {
                     this.b.a(var1 + var7, var2 + var5, false).copy(this.b.a(var1 + var7, var2 + var5 - 1, false));
                  }
               }
            }

            var7 = var6.b;
            PivotItem var9;
            Object var10;
            Style var11;
            int var12;
            Object var13;
            Style var14;
            int var15;
            PivotItem var17;
            if (var6.e()) {
               if (var6.c()) {
                  if (var6.b > 0) {
                     for(var12 = 0; var12 < var6.b; ++var12) {
                        var3 = this.b.a(var1 + var12, var5 + var2, false);
                        this.a(var3);
                     }
                  }

                  var17 = this.a.getColumnFields().get(var7).getPivotItems().get(var6.f[var7]);
                  var13 = this.a(var17);
                  var3 = this.b.a(var1 + var7, var2 + var5, false);
                  if (var3 != null) {
                     var14 = this.a(this.a.getColumnFields().get(var7), var17);
                     if (var13 instanceof DateTime || !var14.getCustom().equals("") || var14.getNumber() != 0) {
                        var3.putValue(var13);
                        var3.setStyle(var14);
                        var13 = var3.getStringValue();
                     }

                     if (var6.b < this.h) {
                        int var16 = var6.f();
                        var3.putValue(var13 + " " + this.a.getDataFields().get(var16).getDisplayName());
                     } else {
                        var3.putValue(var13 + var6.b());
                     }

                     this.a(var3);
                  }

                  if (var1 + var7 + 1 < this.a.n) {
                     for(var15 = var1 + var7 + 1; var15 < this.a.n; ++var15) {
                        var3 = this.b.a(var15, var5 + var2, false);
                        this.a(var3);
                     }
                  }
               } else if (var6.d()) {
                  var3 = this.b.a(var1, var2 + var5, false);
                  if (this.a.getDataField() == null) {
                     var3.putValue(this.a.getGrandTotalName());
                  } else {
                     var3.putValue("Total " + this.a.getDataFields().get(var6.f()).getDisplayName());
                  }

                  this.a(var3);

                  for(var12 = var1 + 1; var12 < this.a.n; ++var12) {
                     var3 = this.b.a(var12, var2 + var5, false);
                     this.a(var3);
                  }
               } else {
                  if (var6.b > 0) {
                     for(var12 = 0; var12 < var6.b; ++var12) {
                        var3 = this.b.a(var1 + var12, var5 + var2, false);
                        this.a(var3);
                     }
                  }

                  if (var6.e + var1 < this.a.n) {
                     for(var12 = var6.e + var1; var12 < this.a.n; ++var12) {
                        var3 = this.b.a(var12, var5 + var2, false);
                        this.a(var3);
                     }
                  }

                  for(var7 = var6.b; var7 < var6.e; ++var7) {
                     if (var7 == this.h) {
                        var12 = var6.f();
                        var3 = this.b.a(var1 + var7, var2 + var5, false);
                        var3.putValue(this.a.getDataFields().get(var12).getDisplayName());
                        this.a(var3);
                     } else {
                        var12 = var6.f[var7];
                        var9 = this.a.getColumnFields().get(var7).getPivotItems().get(var12);
                        var3 = this.b.a(var1 + var7, var2 + var5, false);
                        if (var3 != null) {
                           var10 = this.a(var9);
                           var3.putValue(var10);
                           var11 = this.a(this.a.getColumnFields().get(var7), var9);
                           if (var10 instanceof DateTime || !var11.getCustom().equals("") || var11.getNumber() != 0) {
                              var3.setStyle(var11);
                           }

                           this.a(var3);
                        }
                     }
                  }
               }
            } else if (var6.c()) {
               if (var6.b > 0) {
                  for(var12 = 0; var12 < var6.b; ++var12) {
                     var3 = this.b.a(var1 + var12, var5 + var2, false);
                     this.a(var3);
                  }
               }

               var17 = this.a.getColumnFields().get(var7).getPivotItems().get(var6.f[var7]);
               var13 = this.a(var17);
               var3 = this.b.a(var1 + var7, var2 + var5, false);
               if (var3 != null) {
                  var14 = this.a(this.a.getColumnFields().get(var7), var17);
                  if (var13 instanceof DateTime || !var14.getCustom().equals("") || var14.getNumber() != 0) {
                     var3.putValue(var13);
                     var3.setStyle(var14);
                     var13 = var3.getStringValue();
                  }

                  var3.putValue(var13 + var6.b());
                  this.a(var3);
               }

               if (var1 + var7 + 1 < this.a.n) {
                  for(var15 = var1 + var7 + 1; var15 < this.a.n; ++var15) {
                     var3 = this.b.a(var15, var5 + var2, false);
                     this.a(var3);
                  }
               }
            } else if (var6.d()) {
               if (var6.b > 0) {
                  for(var12 = 0; var12 < var6.b; ++var12) {
                     var3 = this.b.a(var1 + var12, var5 + var2, false);
                     this.a(var3);
                  }
               }

               var3 = this.b.a(var1 + var7, var2 + var5, false);
               var3.putValue(this.a.getGrandTotalName());
               this.a(var3);
               if (var1 + var7 + 1 < this.a.n) {
                  for(var12 = var1 + var7 + 1; var12 < this.a.n; ++var12) {
                     var3 = this.b.a(var12, var5 + var2, false);
                     this.a(var3);
                  }
               }
            } else {
               if (var6.b > 0) {
                  for(var12 = 0; var12 < var6.b; ++var12) {
                     var3 = this.b.a(var1 + var12, var5 + var2, false);
                     this.a(var3);
                  }
               }

               if (var6.e + var1 < this.a.n) {
                  for(var12 = var6.e + var1; var12 < this.a.n; ++var12) {
                     var3 = this.b.a(var12, var5 + var2, false);
                     this.a(var3);
                  }
               }

               for(var7 = var6.b; var7 < var6.e; ++var7) {
                  var12 = var6.f[var7];
                  var9 = this.a.getColumnFields().get(var7).getPivotItems().get(var12);
                  var3 = this.b.a(var1 + var7, var2 + var5, false);
                  if (var3 != null) {
                     var10 = this.a(var9);
                     var3.putValue(var10);
                     var11 = this.a(this.a.getColumnFields().get(var7), var9);
                     if (var10 instanceof DateTime || !var11.getCustom().equals("") || var11.getNumber() != 0) {
                        var3.setStyle(var11);
                     }

                     this.a(var3);
                  }
               }
            }
         }

      }
   }

   private boolean a(zbrd var1, PivotFieldCollection var2) {
      PivotItem var3 = null;

      int var4;
      for(var4 = var1.b; var4 < var1.e; ++var4) {
         var3 = var2.get(var4).getPivotItems().get(var1.f[var4]);
         if (var3.b()) {
            return true;
         }
      }

      if (var1.c != 0) {
         int var5;
         if (var2.getType() == 1) {
            var4 = this.z.length;

            for(var5 = var1.b + var1.e; var5 < var4; ++var5) {
               if (this.z[var5]) {
                  return true;
               }
            }
         } else {
            var4 = this.A.length;

            for(var5 = var1.b + var1.e; var5 < var4; ++var5) {
               if (this.A[var5]) {
                  return true;
               }
            }
         }
      }

      return false;
   }

   private PivotField a(zbrd var1, zbrd var2) {
      if (this.a.getDataFields() != null && this.q != 0) {
         if (var1 != null && var1.e()) {
            return this.a.getDataFields().get(var1.f());
         } else {
            return var2 != null && var2.e() ? this.a.getDataFields().get(var2.f()) : this.a.getDataFields().get(0);
         }
      } else {
         return null;
      }
   }

   private void a(int var1, int var2, zbrd var3, ArrayList var4) {
      if (var3 == null || !this.a(var3, this.a.getRowFields())) {
         PivotFieldCollection var5 = this.a.getColumnFields();
         if (var3 != null) {
            if (var3.c == 14) {
               return;
            }

            if (var3.c == 0 && var3.e < var3.f.length && var3.b != var3.f.length - 1) {
               return;
            }

            var4 = this.b(var4, var3, this.g == 1, this.a.getRowFields());
         }

         Cell var6 = null;
         if (this.I != null && this.I.size() != 0) {
            int var19 = this.I.size();

            for(int var8 = 0; var8 < var19; ++var8) {
               zbrd var9 = (zbrd)this.I.get(var8);
               ArrayList var10;
               String var11;
               int var12;
               int var13;
               if (var9.d()) {
                  var10 = new ArrayList();
                  var11 = null;
                  var12 = 0;
                  zbrd var21;
                  int[] var22;
                  boolean var23;
                  if (this.p > 0 && var5.get(0).isAutoSubtotals()) {
                     for(var13 = var8 - 1; var13 >= 0; --var13) {
                        var21 = (zbrd)this.I.get(var8);
                        if (var21.c() && var21.b == 0) {
                           var6 = this.b.checkCell(var1, var2 + var13);
                           if (var6 != null && !var6.d()) {
                              var22 = new int[]{var12};
                              var23 = !zauu.a(var10, var6, var22);
                              var12 = var22[0];
                              if (var23) {
                                 var11 = var6.j();
                                 break;
                              }
                           }
                        }
                     }
                  } else {
                     for(var13 = var8 - 1; var13 >= 0; --var13) {
                        var21 = (zbrd)this.I.get(var8);
                        if (!var21.c()) {
                           var6 = this.b.checkCell(var1, var2 + var13);
                           if (var6 != null && !var6.d()) {
                              var22 = new int[]{var12};
                              var23 = !zauu.a(var10, var6, var22);
                              var12 = var22[0];
                              if (var23) {
                                 var11 = var6.j();
                                 break;
                              }
                           }
                        }
                     }
                  }

                  var6 = this.b.a(var1, var2 + var8, false);
                  if (var11 != null) {
                     var6.putValue(this.a((Object)var11));
                  } else {
                     var6.putValue(zauv.a(this.a(var3, var9).getFunction(), var12, var10, false));
                  }

                  this.a(var6);
               } else if (!var9.c()) {
                  if (this.a(var9, this.a.getColumnFields())) {
                     var10 = this.a(var4, var9, this.g == 2, this.a.getColumnFields());
                     var6 = this.b.a(var1, var2 + var8, false);
                     var6.putValue(this.a(var10, true, var3, var9));
                     this.a(var6);
                  } else {
                     var10 = this.b(var4, var9, this.g == 2, this.a.getColumnFields());
                     Object var20 = this.a((PivotItem)null, (PivotItem)null, var10, true, this.a(var3, var9), 0, (zbrd)null);
                     var20 = this.a(var20);
                     var6 = this.b.a(var1, var2 + var8, false);
                     var6.putValue(var20);
                     this.a(var6);
                  }
               } else {
                  var10 = new ArrayList();
                  var11 = null;
                  var12 = 0;
                  var13 = var9.b;
                  boolean var14 = true;
                  int var15;
                  zbrd var16;
                  int var17;
                  boolean var18;
                  int[] var24;
                  if (var13 != this.p - 1 && var5.get(var13 + 1).isAutoSubtotals()) {
                     for(var15 = var8 - 1; var15 >= 0; --var15) {
                        var16 = (zbrd)this.I.get(var15);
                        if (var16.c()) {
                           var14 = true;

                           for(var17 = 0; var17 <= var13; ++var17) {
                              if (var9.f[var17] != var16.f[var17]) {
                                 var14 = false;
                                 break;
                              }
                           }

                           if (var14) {
                              var6 = this.b.checkCell(var1, var2 + var15);
                              if (var6 != null && !var6.d()) {
                                 var24 = new int[]{var12};
                                 var18 = !zauu.a(var10, var6, var24);
                                 var12 = var24[0];
                                 if (var18) {
                                    var11 = var6.j();
                                    break;
                                 }
                              }
                           }
                        }
                     }
                  } else {
                     for(var15 = var8 - 1; var15 >= 0; --var15) {
                        var16 = (zbrd)this.I.get(var15);
                        if (var16.c()) {
                           break;
                        }

                        var14 = true;

                        for(var17 = 0; var17 <= var13; ++var17) {
                           if (var9.f[var17] != var16.f[var17]) {
                              var14 = false;
                              break;
                           }
                        }

                        if (var14) {
                           var6 = this.b.checkCell(var1, var2 + var15);
                           if (var6 != null && !var6.d()) {
                              var24 = new int[]{var12};
                              var18 = !zauu.a(var10, var6, var24);
                              var12 = var24[0];
                              if (var18) {
                                 var11 = var6.j();
                                 break;
                              }
                           }
                        }
                     }
                  }

                  var6 = this.b.a(var1, var2 + var8, false);
                  if (var11 != null) {
                     var6.putValue(this.a((Object)var11));
                  } else {
                     var6.putValue(zauv.a(this.a(var3, var9).getFunction(), var12, var10, false));
                  }

                  this.a(var6);
               }
            }

         } else {
            Object var7 = this.a((PivotItem)null, (PivotItem)null, var4, true, this.a((zbrd)var3, (zbrd)null), 0, (zbrd)null);
            var7 = this.a(var7);
            var6 = this.b.a(var1, var2, false);
            var6.putValue(var7);
            this.a(var6);
         }
      }
   }

   private Object a(Object var1) {
      if (var1 != null && var1 instanceof String && zsk.b((String)var1) && this.a.getDisplayErrorString()) {
         if (this.a.getErrorString().equals("-")) {
            var1 = 0;
         } else {
            var1 = this.a.getErrorString();
         }
      } else if (var1 == null && this.a.getDisplayNullString()) {
         var1 = this.a.getNullString();
      }

      if ("".equals(var1)) {
         var1 = null;
      }

      return var1;
   }

   private void b(int var1, int var2, zbrd var3, ArrayList var4) {
      this.m = var1 - this.a.n;
      PivotField var5 = null;
      ArrayList var6 = null;
      Cell var7 = null;
      if (var3 != null) {
         if (var3.c == 14) {
            return;
         }

         if (var4 == null) {
            if (!var3.d() && (var3.a() >= this.o || !this.a.getRowFields().get(var3.a()).getShowSubtotalAtTop())) {
               return;
            }

            var4 = this.b(this.e, var3, this.g == 1, this.a.getRowFields());
         }
      }

      if (this.I != null && this.I.size() != 0) {
         int var13 = this.I.size();

         for(int var14 = 0; var14 < var13; ++var14) {
            zbrd var10 = (zbrd)this.I.get(var14);
            var5 = this.a(var3, var10);
            if (var5 != null) {
               if (var4 == null) {
                  var6 = this.b(this.e, var10, this.g == 2, this.a.getColumnFields());
               } else {
                  var6 = this.b(var4, var10, this.g == 2, this.a.getColumnFields());
               }

               Object var11 = this.a((PivotItem)null, (PivotItem)null, var6, true, var5, var14, var10);
               if (var11 instanceof zst) {
                  var11 = zsk.a((zst)var11);
               }

               var11 = this.a(var11);
               var7 = this.b.a(var1, var2 + var14, false);
               var7.putValue(var11);
               Style var12;
               if (var5.getNumber() != 0) {
                  var12 = new Style();
                  var12.setNumber(var5.getNumber());
                  var7.setStyle(var12);
               }

               if (!"".equals(var5.getNumberFormat())) {
                  var12 = new Style();
                  var12.setCustom(var5.getNumberFormat());
                  var7.setStyle(var12);
               }

               this.a(var7);
            }
         }

      } else {
         var5 = this.a((zbrd)var3, (zbrd)null);
         if (var5 != null) {
            Object var8 = this.a((PivotItem)null, (PivotItem)null, var4, true, var5, 0, (zbrd)null);
            if (var8 instanceof zst) {
               var8 = zsk.a((zst)var8);
            }

            var8 = this.a(var8);
            var7 = this.b.a(var1, var2, false);
            var7.putValue(var8);
            Style var9;
            if (var5.getNumber() != 0) {
               var9 = new Style();
               var9.setNumber(var5.getNumber());
               var7.setStyle(var9);
            }

            if (!"".equals(var5.getNumberFormat())) {
               var9 = new Style();
               var9.setCustom(var5.getNumberFormat());
               var7.setStyle(var9);
            }

            this.a(var7);
         }

      }
   }

   private void a(int[] var1) {
      com.aspose.cells.b.a.a.ze.a(this.E, (Object)com.aspose.cells.b.a.za.a(var1));
      com.aspose.cells.b.a.a.ze.a(this.F, (Object)(new zbrd(var1)));
      com.aspose.cells.b.a.a.ze.a(this.G, (Object)(new zbrd(var1, this.G)));
   }

   private void a(int[] var1, ArrayList var2) {
      com.aspose.cells.b.a.a.ze.a(this.E, (Object)com.aspose.cells.b.a.za.a(var1));
      com.aspose.cells.b.a.a.ze.a(this.F, (Object)(new zbrd(var1, var2, true)));
      com.aspose.cells.b.a.a.ze.a(this.G, (Object)(new zbrd(var1, this.G)));
   }

   void d() {
      boolean var1 = false;
      int[] var2;
      int var3;
      PivotField var4;
      if (this.o > 0) {
         var2 = new int[4 + this.o];

         for(var3 = 0; var3 < this.o; ++var3) {
            var4 = this.a.getRowFields().get(var3);
            if (var4.i()) {
               var1 = true;
            }

            var2[4 + var3] = 32767;
         }

         if (this.g == 1) {
            var2[3] |= 4096;
         }

         this.a.g = this.E = new ArrayList();
         this.H = this.F = new ArrayList();
         this.s = this.G = new ArrayList();
         this.a.getRowFields().c();
         this.a(this.c, this.a.getRowFields(), var2, 0, var1);
      } else {
         this.a.g = this.E = new ArrayList();
         this.s = new ArrayList();
      }

      var1 = false;
      if (this.p > 0) {
         var2 = new int[4 + this.p];

         for(var3 = 0; var3 < this.p; ++var3) {
            var4 = this.a.getColumnFields().get(var3);
            if (var4.i()) {
               var1 = true;
            }

            var2[4 + var3] = 32767;
         }

         if (this.g == 2) {
            var2[3] |= 4096;
         }

         this.a.h = this.E = new ArrayList();
         this.I = this.F = new ArrayList();
         this.t = this.G = new ArrayList();
         this.a.getColumnFields().c();
         this.a(this.d, this.a.getColumnFields(), var2, 0, var1);
      } else {
         this.a.h = this.E = new ArrayList();
         this.t = new ArrayList();
      }

   }

   void e() {
      int var1 = this.a.i;
      int var2 = this.a.k;
      if (this.j) {
         if (this.a.a.b.getWorkbook().getFileFormat() == 5) {
            this.a.j = var1 + 13;
            this.a.l = var2 + 6;
            this.a.m = this.a.n = var1 + 1;
            this.a.o = var2 + 1;
         } else {
            this.a.j = var1 + 17;
            this.a.l = var2 + 2;
            this.a.m = this.a.n = var1 + 1;
            this.a.o = var2 + 1;
         }

      } else {
         int var3 = var1 + 1;
         if ((!this.a.isGridDropZones() || this.a.getDataField() != null && (this.a.getDataField() == null || this.a.getDataField().m == 1)) && (this.p <= 1 || !this.a.getShowRowHeaderCaption()) && (this.p != 1 || this.a.getColumnFields().get(0).t == -2) && (this.p != 1 || this.a.getColumnFields().get(0).t != -2 || this.a.J || !this.a.getShowRowHeaderCaption())) {
            var3 = var1;
         }

         if (this.i) {
            if (this.q == 0 && !this.a.getDisplayImmediateItems()) {
               this.a.j = var1 + 13;
               this.a.l = var2 + this.D + 5;
               this.a.m = var3;
               this.a.n = var1 + this.p == 0 ? 1 : this.p;
               this.a.o = var2 + this.D;
            } else {
               if (!this.a.isGridDropZones() && this.o == 0 && this.p == 1 && this.a.getColumnFields().get(0).c() < 0) {
                  this.a.o = var2;
               } else {
                  this.a.o = var2 + this.D;
               }

               if (this.p == 0 && (this.a.isGridDropZones() || this.a.a.b.getWorkbook().getFileFormat() == 5) && (this.a.getDataField() == null || this.a.getDataField().m != 1)) {
                  this.a.m = var3 + 1;
               } else {
                  this.a.m = var3;
                  if (this.p == 0 && (this.a.getDataField() == null && !this.a.isGridDropZones() || this.a.getDataField() != null && this.a.getDataField().m == 1 && (this.a.isGridDropZones() || this.a.D))) {
                     ++this.a.m;
                  }
               }

               if (this.p != 0) {
                  this.a.l = this.a.o + this.a.h.size() - 1;
                  if (this.a.h.size() == 0) {
                     this.a.l = this.a.o + this.p - 1;
                  }

                  if (!this.a.getShowRowHeaderCaption() && this.q <= 0 || this.a.getDataField() != null && (this.a.getDataField() == null || this.a.getDataField().m == 2 || !this.a.getShowRowHeaderCaption()) && this.p <= 1 && !this.a.isGridDropZones() && (this.a.J || !this.a.getShowRowHeaderCaption() || this.p != 1 || this.a.getDataField() == null || this.a.getDataField().m != 2)) {
                     this.a.n = var1 + this.p;
                  } else {
                     this.a.n = var1 + this.p + 1;
                  }
               } else {
                  if (this.q == 0 && this.a.isGridDropZones()) {
                     this.a.l = this.a.o + 6;
                  } else if (this.D != 0 && this.q == 0 && this.p == 0) {
                     this.a.l = this.a.o - 1;
                  } else {
                     this.a.l = this.a.o;
                  }

                  if (!this.a.isGridDropZones() && (this.a.a.b.getWorkbook().getFileFormat() == 6 || this.a.a.b.getWorkbook().getFileFormat() == 8) || this.a.getDataField() != null && this.a.getDataField().m == 1) {
                     this.a.n = var3;
                     if (this.p == 0 && (this.a.getDataField() == null && !this.a.isGridDropZones() || this.a.getDataField() != null && this.a.getDataField().m == 1 && (this.a.isGridDropZones() || this.a.D))) {
                        ++this.a.n;
                     }
                  } else {
                     this.a.n = var3 + 1;
                  }
               }

               if (this.o != 0) {
                  this.a.j = this.a.n + this.a.g.size() - 1;
               } else if (this.q == 0) {
                  this.a.j = this.a.n + 13;
               } else {
                  this.a.j = this.a.n;
               }
            }
         } else if (this.q == 0 && !this.a.getDisplayImmediateItems()) {
            this.a.j = var1 + 13;
            this.a.m = this.a.n = var3;
            this.a.o = var2 + this.D;
            this.a.l = var2 + 5 + this.D;
         } else {
            this.a.o = var2 + this.D;
            this.a.m = var3;
            this.a.l = this.a.o + (this.q == 0 ? 0 : this.q - 1);
            this.a.n = var1 + 1;
            if (this.o != 0) {
               this.a.j = this.a.n + this.a.g.size() - 1;
            } else {
               this.a.j = this.a.n;
            }
         }

      }
   }

   private void a(zaux var1, PivotFieldCollection var2, int[] var3, int var4, boolean var5) {
      PivotField var6 = var2.get(var4);
      int var7 = var2.getCount();
      int var8 = var3[0];
      boolean var9 = var6.i();
      if (!var9 && var6.isAutoSort() && var6.getAutoSortField() > 0 && var6.getAutoSortField() < this.q) {
         this.a(var1, var2, var4);
      }

      int var10 = var1.d.size();

      int var11;
      for(var11 = 0; var11 < var10; ++var11) {
         zaux var12 = (zaux)var1.d.get(var11);
         var3[4 + var4] = var12.b;
         if (var9) {
            var3[3] |= var12.a.getIndex() << 1;
         }

         int var13;
         if (var4 + 1 == var2.getCount()) {
            var3[2] = var4 + 1;
            this.a(var3, var12.c);
            var3[0] = var4;
         } else if (var12.a.a()) {
            var3[2] = var4 + 1;

            for(var13 = var4 + 1; var13 < var7; ++var13) {
               var3[4 + var13] = 32767;
            }

            if (this.g == var2.getType() && var4 < this.h) {
               if (var6.getShowInOutlineForm()) {
                  this.a(var3, var12.c);
                  var3[2] = this.h + 1;
                  var3[0] = this.h;

                  for(var13 = 0; var13 < this.q; ++var13) {
                     var3[3] |= var13 << 1;
                     var3[4 + this.h] = var13;
                     this.a(var3, var12.c);
                     var3[3] &= 65025;
                  }
               } else {
                  var3[4 + this.h] = 0;
                  this.a(var3, var12.c);
                  var3[2] = this.h + 1;
                  var3[0] = this.h;

                  for(var13 = 1; var13 < this.q; ++var13) {
                     var3[3] |= var13 << 1;
                     var3[4 + this.h] = var13;
                     this.a(var3, var12.c);
                     var3[3] &= 65025;
                  }
               }

               var3[0] = var4;
            } else {
               var3[0] = var4;
               this.a(var3, var12.c);
            }

            var3[2] = var4 + 1;
         } else if (var9) {
            if (var4 != var7 - 1 && this.g == 1) {
               var3[0] = var4;
               var3[2] = var4 + 1;
               this.a((int[])var3, (ArrayList)null);
               ++var3[0];
            }

            this.a(var12, var2, var3, var4 + 1, var5);
         } else {
            boolean var15 = false;
            if (var2.getType() == 1) {
               if (var4 > 0 && !var2.get(var4 - 1).getShowInOutlineForm() && var2.get(var4).getShowInOutlineForm()) {
                  if (var11 == 0) {
                     var3[2] = var4 + 1;
                     this.a(var3, var12.c);
                     var3[0] = var4 + 1;
                  } else {
                     var3[0] = var4;
                     var3[2] = var4 + 1;
                     this.a(var3, var12.c);
                     var3[0] = var4 + 1;
                  }
               } else if (!var6.getShowInOutlineForm()) {
                  if (var12.d.size() > 0 && var11 > 0) {
                     var3[0] = var4;
                  }
               } else {
                  var3[0] = var4;
                  var3[2] = var4 + 1;

                  for(int var14 = var4 + 1; var14 < var7; ++var14) {
                     var3[4 + var14] = 32767;
                  }

                  if (!var6.getShowSubtotalAtTop()) {
                     this.a((int[])var3, (ArrayList)null);
                  } else {
                     this.a(var3, var12.c);
                  }

                  ++var3[0];
                  var15 = true;
               }
            }

            this.a(var12, var2, var3, var4 + 1, var5);
            if (var11 == 0 && !var15 && var6.getShowInOutlineForm()) {
               ++var3[0];
               var15 = false;
            }

            if (var12.d.size() > 0) {
               if (var2.getType() == 2) {
                  if ((!var5 || var5 && var7 > 2 && !var6.k()) && var6.getPosition() + 1 < var7 && !var2.get(var6.getPosition() + 1).i()) {
                     var3[0] = var4;
                     var3[1] = 1;
                     var3[2] = 1;
                     this.a(var3, var4, var2, var6, var12.c);
                  }

                  if (var5) {
                     var3[0] = var8;
                  }
               } else if ((!var5 || var5 && var7 > 2 && !var6.k()) && this.a.getDataField() != null && var6.getPosition() < this.a.getDataField().getPosition() && (this.a.getDataField().getPosition() != var7 - 1 || this.a.getDataField().getPosition() == var7 - 1 && var6.getPosition() < var7 - 2) || !var6.getShowInOutlineForm() && !var6.k() && var6.getPosition() + 1 < var2.getCount() && !var2.get(var6.getPosition() + 1).i() || var6.getShowInOutlineForm() && !var6.getShowSubtotalAtTop()) {
                  var3[0] = var4;
                  this.a(var3, var4, var2, var6, var12.c);
               }
            }
         }

         if (var9) {
            var3[3] &= 65025;
         }

         if (!var6.i() && var6.getInsertBlankRow() && var2.getType() == 1 && var4 != var2.getCount() - 1 && this.E != null && this.E.size() > 0 && ((int[])((int[])this.E.get(this.E.size() - 1)))[1] != 14) {
            var13 = var3[1];
            var3[1] = 14;
            this.a(var3, var12.c);
            var3[1] = var13;
         }
      }

      var3[0] = var8;
      if (var4 == 0) {
         if (this.a(var2)) {
            this.a(var3, var2);
         }

         if (this.p == 1 && (this.a.getColumnFields().get(0).t == -2 || this.a.getColumnFields().get(0).t == 65534) && var2.getType() == 2 || this.o == 1 && (this.a.getRowFields().get(0).t == -2 || this.a.getRowFields().get(0).t == 65534) && var2.getType() == 1) {
            return;
         }

         if (this.a.getRowGrand() && var2.getType() == 2 || this.a.getColumnGrand() && var2.getType() == 1) {
            if (var2.a() && var2.getType() == 1 && this.E != null && this.E.size() > 0 && ((int[])((int[])this.E.get(this.E.size() - 1)))[1] != 14) {
               var11 = var3[1];
               var3[1] = 14;
               this.a(var3, this.e);
               var3[1] = var11;
            }

            if (this.a.getDataField() != null && this.a.getDataField().m == 1 && var2.c == 1 || this.a.getDataField() != null && this.a.getDataField().m == 2 && var2.c == 2) {
               var3[3] |= 1;
            }

            var3[0] = 0;
            var3[1] = 13;
            var3[2] = 1;
            var3[3] |= 2560;
            var3[4] = 0;

            for(var11 = 1; var11 < var7; ++var11) {
               var3[4 + var11] = 32767;
            }

            if (this.g == var2.getType()) {
               this.a(var3, var4);
            } else {
               this.a(var3, this.e);
            }
         }
      }

   }

   private void a(int[] var1, PivotFieldCollection var2) {
      int var3 = var2.getCount() - 1;
      PivotField var4 = var2.get(var3);
      var1[0] = var3 + 1;
      var1[2] = var3;
      var1[3] |= 1024;
      int var5 = var2.getCount();

      int var6;
      for(var6 = 0; var6 < var5 - 1; ++var6) {
         var1[4 + var6] = 32767;
      }

      var6 = var4.getPivotItems().getCount();

      for(int var7 = 0; var7 < var6; ++var7) {
         PivotItem var8 = var4.getPivotItems().get(var7);
         if (!var8.isHidden()) {
            var1[var3] = var7;
            this.a(var1, var3, var2, var4);
         }
      }

      var1[3] &= 64511;
      var1[1] = 0;
   }

   private void a(int[] var1, int var2) {
      for(int var3 = 0; var3 < this.q; ++var3) {
         PivotField var4 = this.a.getDataFields().get(var3);
         var1[3] |= var3 << 1;
         this.a(var1);
         var1[3] &= 65025;
      }

   }

   private void a(int[] var1, int var2, PivotFieldCollection var3, PivotField var4) {
      if (!var4.getSubtotals(0)) {
         if (!this.y && !var4.isAutoSubtotals()) {
            if (var4.getSubtotals(2)) {
               var1[1] = 2;
               this.a(var1, var2);
            }

            if (var4.getSubtotals(128)) {
               var1[1] = 3;
               this.a(var1, var2);
            }

            if (var4.getSubtotals(4)) {
               var1[1] = 4;
               this.a(var1, var2);
            }

            if (var4.getSubtotals(8)) {
               var1[1] = 5;
               this.a(var1, var2);
            }

            if (var4.getSubtotals(16)) {
               var1[1] = 6;
               this.a(var1, var2);
            }

            if (var4.getSubtotals(32)) {
               var1[1] = 7;
               this.a(var1, var2);
            }

            if (var4.getSubtotals(64)) {
               var1[1] = 8;
               this.a(var1, var2);
            }

            if (var4.getSubtotals(256)) {
               var1[1] = 9;
               this.a(var1, var2);
            }

            if (var4.getSubtotals(512)) {
               var1[1] = 10;
               this.a(var1, var2);
            }

            if (var4.getSubtotals(1024)) {
               var1[1] = 11;
               this.a(var1, var2);
            }

            if (var4.getSubtotals(2048)) {
               var1[1] = 12;
               this.a(var1, var2);
            }
         } else {
            var1[1] = 1;
            this.a(var1, var2);
         }

         var1[1] = 0;
      }
   }

   private void a(int[] var1, int var2, PivotFieldCollection var3, PivotField var4, ArrayList var5) {
      var1[2] = var2 + 1;
      var1[3] |= 512;
      if (var3.getType() == this.g && var2 < this.h) {
         this.a(var1, var2, var3, var4);
      } else if (!var4.getSubtotals(0)) {
         if (!this.y && !var4.isAutoSubtotals()) {
            if (var4.getSubtotals(2)) {
               var1[1] = 2;
               this.a(var1, var5);
            }

            if (var4.getSubtotals(128)) {
               var1[1] = 3;
               this.a(var1, var5);
            }

            if (var4.getSubtotals(4)) {
               var1[1] = 4;
               this.a(var1, var5);
            }

            if (var4.getSubtotals(8)) {
               var1[1] = 5;
               this.a(var1, var5);
            }

            if (var4.getSubtotals(16)) {
               var1[1] = 6;
               this.a(var1, var5);
            }

            if (var4.getSubtotals(32)) {
               var1[1] = 7;
               this.a(var1, var5);
            }

            if (var4.getSubtotals(64)) {
               var1[1] = 8;
               this.a(var1, var5);
            }

            if (var4.getSubtotals(256)) {
               var1[1] = 9;
               this.a(var1, var5);
            }

            if (var4.getSubtotals(512)) {
               var1[1] = 10;
               this.a(var1, var5);
            }

            if (var4.getSubtotals(1024)) {
               var1[1] = 11;
               this.a(var1, var5);
            }

            if (var4.getSubtotals(2048)) {
               var1[1] = 12;
               this.a(var1, var5);
            }
         } else {
            var1[1] = 1;
            this.a(var1, var5);
         }
      }

      var1[3] &= 65023;
      var1[1] = 0;
   }

   private int[][] l() {
      int var1 = 0;

      for(int var2 = 0; var2 < this.r; ++var2) {
         PivotField var3 = this.a.getPageFields().get(var2);
         if (var3.getCurrentPageItem() >= 0 && var3.getCurrentPageItem() <= var3.getPivotItems().getCount()) {
            ++var1;
         }
      }

      if (var1 == 0) {
         return (int[][])null;
      } else {
         return this.a(var1);
      }
   }

   void f() {
      this.x = this.a.d.n.b;
      this.e = new ArrayList();
      ArrayList var1 = this.a.d.n.a;
      int var2 = 0;
      boolean var3 = false;
      HashMap[] var4 = new HashMap[this.x.length];

      int var5;
      PivotField var6;
      int var7;
      PivotItem var8;
      HashMap var9;
      int var15;
      for(var5 = 0; var5 < this.o; ++var5) {
         var6 = this.a.getRowFields().get(var5);
         if (!var6.i()) {
            var15 = var6.getPivotItems().getCount();

            for(var7 = 0; var7 < var15; ++var7) {
               var8 = var6.getPivotItems().get(var7);
               if (var6.getPivotItems().get(var7).isHidden()) {
                  var9 = var4[var6.k.c()];
                  if (var9 == null) {
                     var9 = new HashMap();
                     var4[var6.k.c()] = var9;
                     ++var2;
                  }

                  var9.put(var8.getIndex(), true);
               }
            }
         }
      }

      for(var5 = 0; var5 < this.p; ++var5) {
         var6 = this.a.getColumnFields().get(var5);
         if (!var6.i()) {
            var15 = var6.getPivotItems().getCount();

            for(var7 = 0; var7 < var15; ++var7) {
               var8 = var6.getPivotItems().get(var7);
               if (var6.getPivotItems().get(var7).isHidden()) {
                  var9 = var4[var6.k.c()];
                  if (var9 == null) {
                     var9 = new HashMap();
                     var4[var6.k.c()] = var9;
                     ++var2;
                  }

                  var9.put(var8.getIndex(), true);
               }
            }
         }
      }

      for(var5 = 0; var5 < this.r; ++var5) {
         var6 = this.a.getPageFields().get(var5);
         var15 = var6.getPivotItems().getCount();

         for(var7 = 0; var7 < var15; ++var7) {
            var8 = var6.getPivotItems().get(var7);
            if (var6.getPivotItems().get(var7).isHidden()) {
               var9 = var4[var6.k.c()];
               if (var9 == null) {
                  var9 = new HashMap();
                  var4[var6.k.c()] = var9;
                  ++var2;
               }

               var9.put(var8.getIndex(), true);
            }
         }
      }

      int var11;
      int var16;
      if (this.a.getPivotFilters() != null && this.a.getPivotFilters().getCount() > 0) {
         var5 = this.a.getPivotFilters().getCount();

         for(var16 = 0; var16 < var5; ++var16) {
            PivotFilter var17 = this.a.getPivotFilters().get(var16);
            if (!zavb.g(var17.b)) {
               int var18 = var17.a;
               AutoFilter var22 = var17.getAutoFilter();
               PivotField var10 = this.a.getBaseFields().get(var18);
               if (!var10.i()) {
                  if (var4[var10.k.c()] != null) {
                     var4[var10.k.c()].clear();

                     for(var11 = 0; var11 < var10.getPivotItems().getCount(); ++var11) {
                        var10.getPivotItems().get(var11).setHidden(false);
                     }
                  }

                  var15 = var10.getPivotItems().getCount();

                  for(var11 = 0; var11 < var15; ++var11) {
                     PivotItem var12 = var10.getPivotItems().get(var11);
                     Object var13 = var12.getValue();
                     if (var13 == null) {
                        var13 = "(blank)";
                     }

                     if (var22.a(var13)) {
                        HashMap var14 = var4[var10.k.c()];
                        if (var14 == null) {
                           var14 = new HashMap();
                           var4[var10.k.c()] = var14;
                           ++var2;
                        }

                        var14.put(var12.getIndex(), true);
                     }
                  }
               }
            }
         }
      }

      var5 = var1.size();

      for(var16 = 0; var16 < var5; ++var16) {
         Object[] var19 = (Object[])((Object[])var1.get(var16));
         boolean var20 = true;
         int var21;
         int var23;
         if (this.f != null) {
            var23 = this.f.length;

            for(var21 = 0; var21 < var23; ++var21) {
               var11 = this.f[var21][0];
               int var24 = this.f[var21][1];
               if (var19[var11] != null && (Integer)var19[var11] != var24) {
                  var20 = false;
                  break;
               }
            }

            if (!var20) {
               continue;
            }
         }

         if (var2 != 0) {
            var23 = var4.length;

            for(var21 = 0; var21 < var23; ++var21) {
               if (var4[var21] != null) {
                  HashMap var25 = var4[var21];
                  if (var19[var21] != null && var19[var21] instanceof Integer && var25.get((Integer)var19[var21]) != null) {
                     var20 = false;
                     break;
                  }
               }
            }

            if (!var20) {
               continue;
            }
         }

         com.aspose.cells.b.a.a.ze.a(this.e, (Object)(new zea(var19)));
      }

   }

   ArrayList a(ArrayList var1, zbrd var2, boolean var3, PivotFieldCollection var4) {
      return null;
   }

   ArrayList b(ArrayList var1, zbrd var2, boolean var3, PivotFieldCollection var4) {
      ArrayList var5 = new ArrayList();
      if (var2.c == 14) {
         return var5;
      } else if (var2.d()) {
         return var1;
      } else if (var1 == null) {
         return var5;
      } else {
         boolean var6 = true;
         PivotField var7 = null;
         boolean var8 = false;
         int var9 = var1.size();

         for(int var10 = 0; var10 < var9; ++var10) {
            zea var11 = (zea)var1.get(var10);
            var6 = true;
            int var19;
            if (var4.getType() == 2) {
               var19 = 0;
            } else {
               var19 = var2.b;
            }

            for(int var12 = var19; var12 < var2.e; ++var12) {
               if (!var3 || var12 != this.h) {
                  var7 = var4.get(var12);
                  if (var2.f[var12] < var7.getPivotItems().getCount() && var7.c() >= 0) {
                     PivotItem var13 = var7.getPivotItems().get(var2.f[var12]);
                     if (!var13.b()) {
                        if (var7.h.j != null && var7.m == 2) {
                           int var14 = var7.h.j.k;
                           boolean var15 = false;
                           int var16 = var2.d.size();

                           for(int var17 = 0; var17 < var16; ++var17) {
                              zea var18 = (zea)var2.d.get(var17);
                              if (var11.a[var14] == null || var18.a[var14] == null) {
                                 break;
                              }

                              if ((Integer)((Integer)var11.a[var14]) == (Integer)var18.a[var14]) {
                                 var15 = true;
                                 break;
                              }
                           }

                           if (!var15) {
                              var6 = false;
                           }
                        } else {
                           if (var11.a[var7.t] == null) {
                              var6 = false;
                              break;
                           }

                           if ((Integer)((Integer)var11.a[var7.t]) != var13.getIndex()) {
                              var6 = false;
                              break;
                           }
                        }
                     }
                  }
               }
            }

            if (var6) {
               com.aspose.cells.b.a.a.ze.a(var5, (Object)var11);
            }
         }

         return var5;
      }
   }

   ArrayList a(ArrayList var1, int var2, int var3) {
      ArrayList var4 = new ArrayList();

      for(int var5 = 0; var5 < var1.size(); ++var5) {
         zea var6 = (zea)var1.get(var5);
         if (var6.a[var2] != null && (Integer)var6.a[var2] == var3) {
            com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
            var1.remove(var5);
            --var5;
         }
      }

      return var4;
   }

   private ArrayList a(int var1, PivotField var2, PivotItem var3, int var4) {
      ArrayList var5 = new ArrayList();
      PivotField var6 = this.a.getBaseFields().get(var4);
      boolean var7 = false;
      int var8;
      Object var9;
      zbmb var10;
      DateTime var11;
      int var14;
      if (var2.h.j.c == 6) {
         var14 = var6.h.c.size();

         for(var8 = 0; var8 < var14; ++var8) {
            var9 = var6.h.c.get(var8);
            var10 = (zbmb)var9;
            if (var10.a instanceof DateTime) {
               var11 = (DateTime)var10.a;
               if (var1 == 1) {
                  if (var11.getMonth() >= 1 && var11.getMonth() <= 3) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 2) {
                  if (var11.getMonth() >= 4 && var11.getMonth() <= 6) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 3) {
                  if (var11.getMonth() >= 7 && var11.getMonth() <= 9) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 4 && var11.getMonth() >= 10 && var11.getMonth() <= 12) {
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
               }
            }
         }
      } else if (var2.h.j.c == 5) {
         var14 = var6.h.c.size();

         for(var8 = 0; var8 < var14; ++var8) {
            var9 = var6.h.c.get(var8);
            var10 = (zbmb)var9;
            if (var10.a instanceof DateTime) {
               var11 = (DateTime)var10.a;
               if (var1 == 1) {
                  if (var11.getMonth() == 1) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 2) {
                  if (var11.getMonth() == 2) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 3) {
                  if (var11.getMonth() == 3) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 4) {
                  if (var11.getMonth() == 4) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 5) {
                  if (var11.getMonth() == 5) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 6) {
                  if (var11.getMonth() == 6) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 7) {
                  if (var11.getMonth() == 7) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 8) {
                  if (var11.getMonth() == 8) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 9) {
                  if (var11.getMonth() == 9) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 10) {
                  if (var11.getMonth() == 10) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 11) {
                  if (var11.getMonth() == 11) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               } else if (var1 == 12 && var11.getMonth() == 12) {
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
               }
            }
         }
      } else if (var2.h.j.c == 7) {
         var14 = var6.h.c.size();

         for(var8 = 0; var8 < var14; ++var8) {
            var9 = var6.h.c.get(var8);
            var10 = (zbmb)var9;
            if (var10.a instanceof DateTime) {
               var11 = (DateTime)var10.a;
               if (var1 != 0 && var1 != var2.h.j.d.size() - 1) {
                  String var12 = (String)var3.getValue();
                  int var13 = zase.C(var12.substring(0, 4));
                  if (var11.getYear() == var13) {
                     com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
                  }
               }
            }
         }
      } else if (var2.h.j.c == 4) {
         var14 = var6.h.c.size();

         for(var8 = 0; var8 < var14; ++var8) {
            var9 = var6.h.c.get(var8);
            var10 = (zbmb)var9;
            if (var10.a instanceof DateTime) {
               var11 = (DateTime)var10.a;
               if (var1 != 0 && var1 != var2.h.j.d.size() - 1 && var1 == var11.getDayOfYear() + 1) {
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
               }
            }
         }
      } else if (var2.h.j.c == 3) {
         var14 = var6.h.c.size();

         for(var8 = 0; var8 < var14; ++var8) {
            var9 = var6.h.c.get(var8);
            var10 = (zbmb)var9;
            if (var10.a instanceof DateTime) {
               var11 = (DateTime)var10.a;
               if (var1 != 0 && var1 != var2.h.j.d.size() - 1 && var11.getHour() == var1 - 1) {
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
               }
            }
         }
      } else if (var2.h.j.c == 2) {
         var14 = var6.h.c.size();

         for(var8 = 0; var8 < var14; ++var8) {
            var9 = var6.h.c.get(var8);
            var10 = (zbmb)var9;
            if (var10.a instanceof DateTime) {
               var11 = (DateTime)var10.a;
               if (var1 != 0 && var1 != var2.h.j.d.size() - 1 && var11.getMinute() == var1 - 1) {
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
               }
            }
         }
      } else if (var2.h.j.c == 1) {
         var14 = var6.h.c.size();

         for(var8 = 0; var8 < var14; ++var8) {
            var9 = var6.h.c.get(var8);
            var10 = (zbmb)var9;
            if (var10.a instanceof DateTime) {
               var11 = (DateTime)var10.a;
               if (var1 != 0 && var1 != var2.h.j.d.size() - 1 && var11.getSecond() == var1 - 1) {
                  com.aspose.cells.b.a.a.ze.a(var5, (Object)var8);
               }
            }
         }
      }

      return var5;
   }

   private ArrayList a(int var1, PivotField var2, PivotItem var3) {
      ArrayList var4 = new ArrayList();
      int var5 = var2.h.c.size();

      for(int var6 = 0; var6 < var5; ++var6) {
         Object var7 = var2.h.c.get(var6);
         zbmb var8 = (zbmb)var7;
         int var17;
         if (var8.a instanceof DateTime) {
            DateTime var16 = (DateTime)var8.a;
            if (var2.h.j.c == 6) {
               if (var1 == 1) {
                  if (var16.getMonth() >= 1 && var16.getMonth() <= 3) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 2) {
                  if (var16.getMonth() >= 4 && var16.getMonth() <= 6) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 3) {
                  if (var16.getMonth() >= 7 && var16.getMonth() <= 9) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 4 && var16.getMonth() >= 10 && var16.getMonth() <= 12) {
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
               }
            } else if (var2.h.j.c == 5) {
               if (var1 == 1) {
                  if (var16.getMonth() == 1) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 2) {
                  if (var16.getMonth() == 2) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 3) {
                  if (var16.getMonth() == 3) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 4) {
                  if (var16.getMonth() == 4) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 5) {
                  if (var16.getMonth() == 5) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 6) {
                  if (var16.getMonth() == 6) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 7) {
                  if (var16.getMonth() == 7) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 8) {
                  if (var16.getMonth() == 8) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 9) {
                  if (var16.getMonth() == 9) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 10) {
                  if (var16.getMonth() == 10) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 11) {
                  if (var16.getMonth() == 11) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               } else if (var1 == 12 && var16.getMonth() == 12) {
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
               }
            } else if (var2.h.j.c == 7) {
               if (var1 != 0 && var1 != var2.h.j.d.size() - 1) {
                  String var10 = (String)var3.getValue();
                  var17 = zase.C(var10.substring(0, 4));
                  if (var16.getYear() == var17) {
                     com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
                  }
               }
            } else if (var2.h.j.c == 4) {
               if (var1 != 0 && var1 != var2.h.j.d.size() - 1 && var1 == var16.getDayOfYear() + 1) {
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
               }
            } else if (var2.h.j.c == 3) {
               if (var1 != 0 && var1 != var2.h.j.d.size() - 1 && var16.getHour() == var1 - 1) {
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
               }
            } else if (var2.h.j.c == 2) {
               if (var1 != 0 && var1 != var2.h.j.d.size() - 1 && var16.getMinute() == var1 - 1) {
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
               }
            } else if (var2.h.j.c == 1 && var1 != 0 && var1 != var2.h.j.d.size() - 1 && var16.getSecond() == var1 - 1) {
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
            }
         } else if (var8.a instanceof Integer || var8.a instanceof Double) {
            double var9 = 0.0D;
            if (var8.a instanceof Integer) {
               var9 = (double)(Integer)var8.a;
            } else {
               var9 = (Double)var8.a;
            }

            double var11;
            if (com.aspose.cells.b.a.zr.a(var3.getValue()).indexOf(60) != -1) {
               var11 = zase.B(com.aspose.cells.b.a.zr.a(var3.getValue()).substring(1));
               if (var9 < var11) {
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
               }
            } else if (com.aspose.cells.b.a.zr.a(var3.getValue()).indexOf("-") != -1) {
               var17 = com.aspose.cells.b.a.zr.a(var3.getValue()).indexOf(45);
               double var12 = zase.B(com.aspose.cells.b.a.zr.a(var3.getValue()).substring(0, 0 + var17));
               double var14 = zase.B(com.aspose.cells.b.a.zr.a(var3.getValue()).substring(var17 + 1));
               if (var9 >= var12 && var9 <= var14) {
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
               }
            } else {
               var11 = zase.B(com.aspose.cells.b.a.zr.a(var3.getValue()).substring(1));
               if (var9 > var11) {
                  com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);
               }
            }
         }
      }

      return var4;
   }

   private void a(zaux var1, PivotFieldCollection var2, int var3, boolean var4) {
      PivotField var5 = var2.get(var3);
      PivotItemCollection var6 = var5.getPivotItems();
      int var7 = var6.getCount();
      int[] var8 = null;
      if (var5.isAutoSort() || var5.g) {
         if (!w) {
            this.p();
            w = true;
         }

         if (var5.getAutoSortField() == -1) {
            if (var2.getType() == 1) {
               if (this.v != null) {
                  var8 = this.v[var3];
               }
            } else if (this.u != null) {
               var8 = this.u[var3];
            }
         }
      }

      boolean var9 = var5.h != null && var5.h.j != null;
      PivotItem var10 = null;
      boolean var11 = var8 != null;
      int var12 = var5.k.c();
      ArrayList var13 = new ArrayList();
      ArrayList var14 = var1.c;
      int var15 = var14.size();

      int var16;
      for(var16 = 0; var16 < var15; ++var16) {
         com.aspose.cells.b.a.a.ze.a(var13, var14.get(var16));
      }

      int var18;
      for(var16 = 0; var16 < var7; ++var16) {
         if (var11) {
            var10 = var6.get(var8[var16]);
         } else {
            var10 = var6.get(var16);
         }

         if (!var5.i() && !var10.b()) {
            ArrayList var31;
            if (var9) {
               var31 = null;
               var18 = var5.h.j.k;
               if (var5.h.c != null && var5.h.c.size() != 0) {
                  if (var5.h.c != null) {
                     var31 = this.a(var16, var5, var10);
                  }
               } else {
                  var31 = this.a(var16, var5, var10, var18);
               }

               new ArrayList();
               ArrayList var20 = new ArrayList();
               int var21 = var31.size();

               for(int var22 = 0; var22 < var21; ++var22) {
                  if (var18 >= 0) {
                     ArrayList var19 = this.a(var13, var18, (Integer)var31.get(var22));
                     if (var19.size() != 0) {
                        com.aspose.cells.b.a.a.ze.a(var20, (Collection)var19);
                     }
                  }
               }

               if (var20.size() != 0) {
                  zaux var40 = new zaux();
                  com.aspose.cells.b.a.a.ze.a(var1.d, (Object)var40);
                  var40.a = var10;
                  if (var11) {
                     var40.b = var8[var16];
                  } else {
                     var40.b = var16;
                  }

                  var40.c = var20;
               }
            } else if (var12 >= 0) {
               var31 = this.a(var13, var12, var10.getIndex());
               if (var31.size() != 0) {
                  zaux var32 = new zaux();
                  com.aspose.cells.b.a.a.ze.a(var1.d, (Object)var32);
                  var32.a = var10;
                  if (var11) {
                     var32.b = var8[var16];
                  } else {
                     var32.b = var16;
                  }

                  var32.c = var31;
               }
            }
         } else {
            zaux var17 = new zaux();
            com.aspose.cells.b.a.a.ze.a(var1.d, (Object)var17);
            var17.a = var10;
            if (var11) {
               var17.b = var8[var16];
            } else {
               var17.b = var16;
            }

            var17.c = var1.c;
         }
      }

      if (var5.isAutoShow()) {
         var16 = var5.getAutoShowField();
         PivotField var34 = this.a.getDataFields().get(var16);
         this.a(var34, var1, var5.isAscendShow(), var5.getAutoShowCount());
      }

      int var35;
      if (this.a.getPivotFilters() != null && this.a.getPivotFilters().getCount() > 0) {
         var16 = this.a.getPivotFilters().getCount();

         for(var35 = 0; var35 < var16; ++var35) {
            PivotFilter var33 = this.a.getPivotFilters().get(var35);
            int var36 = var33.a;
            int var38 = var33.getMeasureFldIndex();
            if (this.q != 0) {
               PivotField var39 = this.a.getDataFields().get(var38);
               AutoFilter var41 = var33.getAutoFilter();
               if (var36 == var5.c()) {
                  if (var33.b != 14 && var33.b != 43) {
                     if (zavb.g(var33.b)) {
                        this.a(var39, var1, var41);
                     }
                  } else {
                     FilterColumnCollection var23 = var41.e;
                     int var24 = var23.getCount();

                     for(int var25 = 0; var25 < var24; ++var25) {
                        FilterColumn var26 = var23.getByIndex(var25);
                        if (var26.getFilterType() == 5) {
                           Top10Filter var27 = (Top10Filter)var26.getFilter();
                           boolean var28 = var27.isTop();
                           boolean var29 = var27.isPercent();
                           int var30 = var27.getItems();
                           if (var29) {
                              var30 = var30 * this.e.size() / 100;
                              if (var30 == 0) {
                                 var30 = 1;
                              }
                           }

                           this.a(var39, var1, var28, var30);
                           break;
                        }
                     }
                  }
               }
            }
         }
      }

      var16 = var1.d.size();
      var35 = var2.getCount();

      for(var18 = 0; var18 < var16; ++var18) {
         zaux var37 = (zaux)var1.d.get(var18);
         if (!var37.a.a() && var37.c != null && var3 + 1 != var35) {
            this.a(var37, var2, var3 + 1, var4);
         }
      }

      if (var4) {
         for(var18 = 0; var18 < var16; ++var18) {
            var1.c = null;
         }
      }

   }

   private int a(PivotField var1) {
      int var2 = 0;
      int var3 = var1.getItemCount();

      for(int var4 = 0; var4 < var3; ++var4) {
         if (!var1.getPivotItems().get(var4).isHidden()) {
            ++var2;
         }
      }

      return var2;
   }

   private Cell[] a(CellArea var1, int var2) {
      Cell[] var3 = new Cell[2];
      int var4 = (var2 + 1) % this.a.getPageFieldWrapCount();
      int var5 = (var2 + 1) / this.a.getPageFieldWrapCount();
      int var6 = var1.StartRow;
      int var7 = var1.StartColumn;
      if (this.a.getPageFieldOrder() == 0) {
         if (var4 > 0) {
            var6 += var4 - 1;
         } else {
            var6 = var1.EndRow;
         }

         if (var5 > 0) {
            var7 += var5 * 3;
            if (var4 == 0) {
               var7 -= 3;
            }
         }
      } else {
         if (var5 > 0) {
            var6 += var5;
            if (var4 == 0) {
               --var6;
            }
         }

         if (var4 > 0) {
            var7 += (var4 - 1) * 3;
         } else {
            var7 = var1.EndColumn - 1;
         }
      }

      var3[0] = this.b.checkCell(var6, var7);
      var3[1] = this.b.checkCell(var6, var7 + 1);
      return var3;
   }

   private void m() {
      Cell var1 = null;
      this.a.am = this.r;
      if (this.a.am > 0) {
         CellArea var2 = this.n();
         int var3 = this.a.i - this.a.am - 1;

         for(int var4 = 0; var4 < this.a.am; ++var4) {
            Cell[] var5 = this.a(var2, var4);
            PivotField var6 = this.a.getPageFields().get(var4);
            int var7 = var6.getPivotItems().getCount();
            var1 = var5[0];
            if (var1 != null) {
               if (var6.getDisplayName() != null && var6.getDisplayName().length() > 0) {
                  var1.putValue(var6.getDisplayName());
               } else {
                  var1.putValue(var6.getName());
               }

               this.a((Cell)var1, var4, 0);
            }

            PivotItem var8;
            Style var10;
            Object var11;
            if (var6.getCurrentPageItem() == 32765 && var6.isMultipleItemSelectionAllowed() && var7 == 1) {
               var1 = var5[1];
               if (var1 != null) {
                  var8 = var6.getPivotItems().get(0);
                  var11 = this.a(var8);
                  var1.putValue(var11);
                  var10 = this.a(var6, var8);
                  if (var11 instanceof DateTime || !var10.getCustom().equals("") || var10.getNumber() != 0) {
                     var1.setStyle(var10);
                  }

                  this.a((Cell)var1, var4, 1);
               }
            } else if (var6.getCurrentPageItem() == 32765 && !var6.isMultipleItemSelectionAllowed() || var6.isMultipleItemSelectionAllowed() && var7 == this.a(var6)) {
               var1 = var5[1];
               if (var1 != null) {
                  var1.putValue("(All)");
                  this.a((Cell)var1, var4, 1);
               }
            } else if (!var6.isMultipleItemSelectionAllowed() || var6.isMultipleItemSelectionAllowed() && var7 - var6.getPivotItems().a() == 1) {
               var1 = var5[1];
               var8 = null;
               if (var6.isMultipleItemSelectionAllowed()) {
                  for(int var9 = 0; var9 < var7; ++var9) {
                     if (!var6.getPivotItems().get(var9).isHidden()) {
                        var8 = var6.getPivotItems().get(var9);
                        break;
                     }
                  }
               } else {
                  var8 = var6.getPivotItems().get(var6.getCurrentPageItem());
               }

               var11 = this.a(var8);
               var1.putValue(var11);
               var10 = this.a(var6, var8);
               if (var11 instanceof DateTime || !var10.getCustom().equals("") || var10.getNumber() != 0) {
                  var1.setStyle(var10);
               }

               this.a((Cell)var1, var4, 1);
            } else if (var6.isMultipleItemSelectionAllowed()) {
               var1 = var5[1];
               if (var1 != null) {
                  var1.putValue("(Multiple Items)");
                  this.a((Cell)var1, var4, 1);
               }
            }
         }
      }

   }

   private CellArea n() {
      CellArea var1 = new CellArea();
      if (this.r > 0) {
         boolean var2 = this.r % this.a.getPageFieldWrapCount() != 0;
         int var3 = this.r / this.a.getPageFieldWrapCount();
         if (this.a.getPageFieldOrder() == 0) {
            var1.StartRow = this.a.i - this.a.getPageFieldWrapCount() - 1;
            var1.EndRow = this.a.i - 1 - 1;
            var1.StartColumn = this.a.k;
            if (var3 <= 1 && (var3 != 1 || !var2)) {
               var1.EndColumn = this.a.k + 1;
            } else {
               var1.EndColumn = this.a.k + 2 + (var3 - 1) * 3;
               var1.EndColumn += var2 ? 2 : -1;
            }
         } else {
            var1.StartRow = this.a.i - 1 - var3;
            var1.StartRow += var2 ? -1 : 0;
            var1.EndRow = this.a.i - 1 - 1;
            var1.StartColumn = this.a.k;
            var1.EndColumn = this.a.k + 2 + (this.a.getPageFieldWrapCount() - 1) * 3 - 1;
         }
      }

      return var1;
   }

   private void o() {
      Cell var1 = null;
      this.a.am = this.r;
      int var3;
      if (this.a.am > 0) {
         CellArea var2 = this.n();
         var3 = 0;
         int var4;
         int var5;
         if (this.a.getPageFieldOrder() == 0) {
            for(var4 = var2.StartColumn; var4 <= var2.EndColumn && var3 < this.r; var4 += 3) {
               for(var5 = var2.StartRow; var5 <= var2.EndRow && var3 < this.r; ++var5) {
                  var1 = this.b.checkCell(var5, var4);
                  if (var1 != null) {
                     var1.b(-1);
                     var1.e();
                  }

                  var1 = this.b.checkCell(var5, var4 + 1);
                  if (var1 != null) {
                     var1.b(-1);
                     var1.e();
                  }

                  ++var3;
               }
            }
         } else {
            for(var4 = var2.StartRow; var4 <= var2.EndRow && var3 < this.r; ++var4) {
               for(var5 = var2.StartColumn; var5 <= var2.EndColumn && var3 < this.r; var5 += 3) {
                  var1 = this.b.checkCell(var4, var5);
                  if (var1 != null) {
                     var1.b(-1);
                     var1.e();
                  }

                  var1 = this.b.checkCell(var4, var5 + 1);
                  if (var1 != null) {
                     var1.b(-1);
                     var1.e();
                  }

                  ++var3;
               }
            }
         }
      }

      for(int var6 = this.a.i; var6 <= this.a.j; ++var6) {
         for(var3 = this.a.k; var3 <= this.a.l; ++var3) {
            var1 = this.b.checkCell(var6, var3);
            if (var1 != null) {
               var1.b(-1);
               var1.e();
            }
         }
      }

   }

   private void p() {
      int var1;
      PivotField var2;
      for(var1 = 0; var1 < this.p; ++var1) {
         var2 = this.a.getColumnFields().get(var1);
         if ((var2.isAutoSort() || var2.g) && var2.getAutoSortField() == -1) {
            if (this.u == null) {
               this.u = new int[this.x.length][];
            }

            this.u[var1] = this.b(var2);
         }
      }

      for(var1 = 0; var1 < this.o; ++var1) {
         var2 = this.a.getRowFields().get(var1);
         if ((var2.isAutoSort() || var2.g) && var2.getAutoSortField() == -1) {
            if (this.v == null) {
               this.v = new int[this.x.length][];
            }

            this.v[var1] = this.b(var2);
         }
      }

   }

   void g() {
      if (this.p != 0) {
         this.d = new zaux();
         this.d.c = this.e;
         this.a(this.d, this.a.getColumnFields(), 0, this.o != 0);
         this.d.c = null;
      }

      if (this.o != 0) {
         this.c = new zaux();
         this.c.c = this.e;
         this.a(this.c, this.a.getRowFields(), 0, false);
         this.c.c = null;
      }

      w = false;
   }

   private int[] b(PivotField var1) {
      if (var1.c() != -2 && var1.c() != 65534) {
         boolean var2 = var1.isAscendSort();
         PivotItemCollection var3 = var1.getPivotItems();
         int var4 = var3.getCount();
         int[] var5 = new int[var4];
         new ArrayList();
         int var7 = -1;
         HashMap var8 = new HashMap();

         for(int var9 = 0; var9 < var4; ++var9) {
            Object var10 = var3.get(var9).getValue();
            if (var10 != null && var10 instanceof String) {
               String var11 = (String)var10;
               switch(J.a(var11.toUpperCase())) {
               case 0:
                  var8.put(var11, 0);
                  break;
               case 1:
                  var8.put(var11, 1);
                  break;
               case 2:
                  var8.put(var11, 2);
                  break;
               case 3:
                  var8.put(var11, 3);
                  break;
               case 4:
                  var8.put(var11, 4);
                  break;
               case 5:
                  var8.put(var11, 5);
                  break;
               case 6:
                  var8.put(var11, 6);
                  break;
               case 7:
                  var8.put(var11, 7);
                  break;
               case 8:
                  var8.put(var11, 8);
                  break;
               case 9:
                  var8.put(var11, 9);
                  break;
               case 10:
                  var8.put(var11, 10);
                  break;
               case 11:
                  var8.put(var11, 11);
                  break;
               case 12:
                  var8.put(var11, 12);
                  break;
               case 13:
                  var8.put(var11, 13);
                  break;
               case 14:
                  var8.put(var11, 14);
                  break;
               case 15:
                  var8.put(var11, 15);
                  break;
               case 16:
                  var8.put(var11, 16);
                  break;
               case 17:
                  var8.put(var11, 17);
                  break;
               case 18:
                  var8.put(var11, 18);
                  break;
               case 19:
                  var8.put(var11, 19);
                  break;
               case 20:
                  var8.put(var11, 20);
                  break;
               case 21:
                  var8.put(var11, 21);
                  break;
               case 22:
                  var8.put(var11, 22);
                  break;
               case 23:
                  var8.put(var11, 23);
                  break;
               case 24:
                  var8.put(var11, 24);
                  break;
               case 25:
                  var8.put(var11, 25);
                  break;
               case 26:
                  var8.put(var11, 26);
                  break;
               case 27:
                  var8.put(var11, 27);
                  break;
               case 28:
                  var8.put(var11, 28);
                  break;
               case 29:
                  var8.put(var11, 29);
                  break;
               case 30:
                  var8.put(var11, 30);
                  break;
               case 31:
                  var8.put(var11, 31);
                  break;
               case 32:
                  var8.put(var11, 32);
                  break;
               case 33:
                  var8.put(var11, 33);
                  break;
               case 34:
                  var8.put(var11, 34);
                  break;
               case 35:
                  var8.put(var11, 35);
                  break;
               case 36:
                  var8.put(var11, 36);
               }
            }
         }

         com.aspose.cells.b.a.a.zd var12 = new com.aspose.cells.b.a.a.zd(new zbnn(var2, var8));

         int var13;
         for(var13 = 0; var13 < var4; ++var13) {
            if (var3.get(var13).getValue() != null) {
               var12.a(var3.get(var13).getValue(), var13);
            } else if (var3.get(var13).e == null) {
               var7 = var13;
            }
         }

         var13 = 0;
         if (!var2 && var7 >= 0) {
            var5[var13++] = var7;
         }

         for(Iterator var14 = var12.f().iterator(); var14.hasNext(); var5[var13++] = (Integer)var14.next()) {
            ;
         }

         if (var2 && var7 >= 0) {
            var5[var13++] = var7;
         }

         return var5;
      } else {
         return null;
      }
   }

   private void a(PivotField var1, zaux var2, boolean var3, int var4) {
      zaup var5 = new zaup(var3, var4);
      int var6 = var2.d.size();

      for(int var7 = 0; var7 < var6; ++var7) {
         zaux var8 = (zaux)var2.d.get(var7);
         Object var9 = this.a(var8.a, (PivotItem)null, var8.c, true, var1, var7, (zbrd)null);
         var9 = this.a(var9);
         var5.a(var9, var8.b);
      }

      HashMap var13 = var5.a();

      for(int var14 = 0; var14 < var2.d.size(); ++var14) {
         zaux var15 = (zaux)var2.d.get(var14);
         if (var13.get(var15.b) == null) {
            if (var15.c != null) {
               int var10 = var15.c.size();

               for(int var11 = 0; var11 < var10; ++var11) {
                  zea var12 = (zea)var15.c.get(var11);
                  var12.b = true;
               }
            }

            var2.d.remove(var14--);
         }
      }

   }

   private void a(PivotField var1, zaux var2, AutoFilter var3) {
      HashMap var4 = new HashMap();
      int var5 = var2.d.size();

      int var6;
      zaux var7;
      for(var6 = 0; var6 < var5; ++var6) {
         var7 = (zaux)var2.d.get(var6);
         Object var8 = this.a(var7.a, (PivotItem)null, var7.c, true, var1, var6, (zbrd)null);
         var8 = this.a(var8);
         if (var8 != null && !var3.a(var8)) {
            var4.put(var7.b, var8);
         }
      }

      for(var6 = 0; var6 < var2.d.size(); ++var6) {
         var7 = (zaux)var2.d.get(var6);
         if (!var4.containsKey(var7.b)) {
            if (var7.c != null) {
               int var11 = var7.c.size();

               for(int var9 = 0; var9 < var11; ++var9) {
                  zea var10 = (zea)var7.c.get(var9);
                  var10.b = true;
               }
            }

            var2.d.remove(var6--);
         }
      }

   }

   int[][] a(int var1) {
      if (var1 < 0) {
         var1 = 0;

         for(int var2 = 0; var2 < this.r; ++var2) {
            PivotField var3 = this.a.getPageFields().get(var2);
            if (var3.getCurrentPageItem() >= 0 && var3.getCurrentPageItem() < var3.getPivotItems().getCount()) {
               ++var1;
            }
         }
      }

      if (var1 == 0) {
         return (int[][])null;
      } else {
         int[][] var6 = new int[var1][];
         var1 = 0;

         for(int var7 = 0; var7 < this.r; ++var7) {
            PivotField var4 = this.a.getPageFields().get(var7);
            if (var4.getCurrentPageItem() >= 0 && var4.getCurrentPageItem() <= var4.getPivotItems().getCount()) {
               PivotItem var5 = var4.getPivotItems().get(var4.getCurrentPageItem());
               var6[var1] = new int[2];
               var6[var1][0] = var4.k.c();
               var6[var1][1] = var5.getIndex();
               ++var1;
            }
         }

         return var6;
      }
   }

   Object a(ArrayList var1, boolean var2, zbrd var3, zbrd var4) {
      return null;
   }

   Object b(int var1) {
      if (this.a.d.L != null && var1 < this.a.d.L.f.size()) {
         zbrf var2 = (zbrf)this.a.d.L.f.get(var1);
         if ((var2.b & '\uffff') >= this.a.d.p.size()) {
            return null;
         } else {
            zbqs var3;
            if ((var2.b & '\uffff') >= this.x.length) {
               var3 = (zbqs)this.a.d.p.get(var2.b & '\uffff');
               if (var3 != null && var3.m()) {
                  zbqs var13 = this.a.d.L;
                  this.a.d.L = var3;
                  Object var15 = this.a(var3.e);
                  this.a.d.L = var13;
                  return var15;
               }
            }

            var3 = (zbqs)this.a.d.p.get(var2.b & '\uffff');
            zbrd var4;
            if (this.H != null && this.I != null) {
               if (this.m < this.H.size() && this.n < this.I.size()) {
                  var4 = (zbrd)this.H.get(this.m);
                  zbrd var14 = (zbrd)this.I.get(this.n);
                  new ArrayList();
                  ArrayList var17;
                  if (this.a.getBaseFields().get(var2.b & '\uffff').m == 1) {
                     var17 = this.b(var4.d, var4, this.g == 1, this.a.getRowFields());
                  } else {
                     var17 = this.b(var4.d, var14, this.g == 2, this.a.getColumnFields());
                  }

                  if (var17 == null) {
                     return null;
                  } else {
                     byte var18 = 0;
                     boolean var19 = false;
                     PivotField var21 = this.a.getBaseFields().get(var3.w());
                     int[] var22 = new int[]{var18};
                     boolean[] var23 = new boolean[]{var19};
                     ArrayList var12 = zauu.a(var17, false, var21, this.x, var21.getFunction(), this.a.d, 0, (zbrd)null, var22, var23);
                     int var20 = var22[0];
                     var19 = var23[0];
                     return zauv.a(var21.getFunction(), var20, var12, var19);
                  }
               } else {
                  return null;
               }
            } else {
               ArrayList var5;
               byte var6;
               boolean var7;
               PivotField var8;
               int[] var9;
               boolean[] var10;
               ArrayList var11;
               int var16;
               if (this.H == null && this.I != null) {
                  if (this.n >= this.I.size()) {
                     return null;
                  } else {
                     var4 = (zbrd)this.I.get(this.n);
                     var5 = this.b(var4.d, var4, this.g == 2, this.a.getColumnFields());
                     if (var5 == null) {
                        return null;
                     } else {
                        var6 = 0;
                        var7 = false;
                        var8 = this.a.getBaseFields().get(var3.w());
                        var9 = new int[]{var6};
                        var10 = new boolean[]{var7};
                        var11 = zauu.a(var5, false, var8, this.x, var8.getFunction(), this.a.d, 0, (zbrd)null, var9, var10);
                        var16 = var9[0];
                        var7 = var10[0];
                        return zauv.a(var8.getFunction(), var16, var11, var7);
                     }
                  }
               } else if (this.H != null && this.I == null) {
                  if (this.m >= this.H.size()) {
                     return null;
                  } else {
                     var4 = (zbrd)this.H.get(this.m);
                     var5 = this.b(var4.d, var4, this.g == 1, this.a.getRowFields());
                     if (var5 == null) {
                        return null;
                     } else {
                        var6 = 0;
                        var7 = false;
                        var8 = this.a.getBaseFields().get(var3.w());
                        var9 = new int[]{var6};
                        var10 = new boolean[]{var7};
                        var11 = zauu.a(var5, false, var8, this.x, var8.getFunction(), this.a.d, 0, (zbrd)null, var9, var10);
                        var16 = var9[0];
                        var7 = var10[0];
                        return zauv.a(var8.getFunction(), var16, var11, var7);
                     }
                  }
               } else {
                  return null;
               }
            }
         }
      } else {
         return null;
      }
   }

   zagu a(int var1, zaay var2) {
      if (this.a.d.L != null && var1 < this.a.d.L.f.size()) {
         zbrf var3 = (zbrf)this.a.d.L.f.get(var1);
         if ((var3.b & '\uffff') >= this.a.d.p.size()) {
            return zzk.a;
         } else {
            zbqs var4;
            if ((var3.b & '\uffff') >= this.x.length) {
               var4 = (zbqs)this.a.d.p.get(var3.b & '\uffff');
               if (var4 != null && var4.m()) {
                  zbqs var14 = this.a.d.L;
                  this.a.d.L = var4;
                  zagu var16 = this.a(var4.e, var2);
                  this.a.d.L = var14;
                  return var16;
               }
            }

            var4 = (zbqs)this.a.d.p.get(var3.b & '\uffff');
            zbrd var5;
            if (this.H != null && this.I != null) {
               if (this.m < this.H.size() && this.n < this.I.size()) {
                  var5 = (zbrd)this.H.get(this.m);
                  zbrd var15 = (zbrd)this.I.get(this.n);
                  new ArrayList();
                  ArrayList var18;
                  if (this.a.getBaseFields().get(var3.b & '\uffff').m == 1) {
                     var18 = this.b(var5.d, var5, this.g == 1, this.a.getRowFields());
                  } else {
                     var18 = this.b(var5.d, var15, this.g == 2, this.a.getColumnFields());
                  }

                  if (var18 == null) {
                     return zzk.a;
                  } else {
                     byte var19 = 0;
                     boolean var20 = false;
                     PivotField var22 = this.a.getBaseFields().get(var4.w());
                     int[] var23 = new int[]{var19};
                     boolean[] var24 = new boolean[]{var20};
                     ArrayList var13 = zauu.a(var18, false, var22, this.x, var22.getFunction(), this.a.d, 0, (zbrd)null, var23, var24);
                     int var21 = var23[0];
                     var20 = var24[0];
                     return zauv.b(var22.getFunction(), var21, var13, var20);
                  }
               } else {
                  return null;
               }
            } else {
               ArrayList var6;
               byte var7;
               boolean var8;
               PivotField var9;
               int[] var10;
               boolean[] var11;
               ArrayList var12;
               int var17;
               if (this.H == null && this.I != null) {
                  if (this.n >= this.I.size()) {
                     return zzk.a;
                  } else {
                     var5 = (zbrd)this.I.get(this.n);
                     var6 = this.b(var5.d, var5, this.g == 2, this.a.getColumnFields());
                     if (var6 == null) {
                        return zzk.a;
                     } else {
                        var7 = 0;
                        var8 = false;
                        var9 = this.a.getBaseFields().get(var4.w());
                        var10 = new int[]{var7};
                        var11 = new boolean[]{var8};
                        var12 = zauu.a(var6, false, var9, this.x, var9.getFunction(), this.a.d, 0, (zbrd)null, var10, var11);
                        var17 = var10[0];
                        var8 = var11[0];
                        return zauv.b(var9.getFunction(), var17, var12, var8);
                     }
                  }
               } else if (this.H != null && this.I == null) {
                  if (this.m >= this.H.size()) {
                     return null;
                  } else {
                     var5 = (zbrd)this.H.get(this.m);
                     var6 = this.b(var5.d, var5, this.g == 1, this.a.getRowFields());
                     if (var6 == null) {
                        return null;
                     } else {
                        var7 = 0;
                        var8 = false;
                        var9 = this.a.getBaseFields().get(var4.w());
                        var10 = new int[]{var7};
                        var11 = new boolean[]{var8};
                        var12 = zauu.a(var6, false, var9, this.x, var9.getFunction(), this.a.d, 0, (zbrd)null, var10, var11);
                        var17 = var10[0];
                        var8 = var11[0];
                        return zauv.b(var9.getFunction(), var17, var12, var8);
                     }
                  }
               } else {
                  return null;
               }
            }
         }
      } else {
         return zzk.a;
      }
   }

   zagu a(byte[] var1, zaay var2) {
      return (zagu)(var1 == null ? zzk.a : (new zyg(var2, var1, 0, var1.length)).a().e(var2));
   }

   Object a(byte[] var1) {
      if (var1 == null) {
         return null;
      } else {
         zabd var2 = this.b.r().x().a((Cell)null, var1, 0);
         if (var2 != null) {
            zyh var3 = new zyh(this.b.r().n());
            return var3.b(var2, (Cell)null);
         } else {
            return null;
         }
      }
   }

   Object a(PivotItem var1, PivotItem var2, ArrayList var3, boolean var4, PivotField var5, int var6, zbrd var7) {
      if (var5.isCalculatedField() && var3.size() != 0) {
         this.l = true;
         this.b.r().a((Object)this);
         this.n = var6;
         this.a.d.L = var5.k.h;
         Object var14 = this.a(var5.k.h.e);
         this.b.r().a((Object)null);
         return var14;
      } else {
         byte var8 = 0;
         boolean var9 = false;
         int[] var10 = new int[]{var8};
         boolean[] var11 = new boolean[]{var9};
         ArrayList var12 = zauu.a(var3, var4, var5, this.x, var5.getFunction(), this.a.d, var6, var7, var10, var11);
         int var13 = var10[0];
         var9 = var11[0];
         return zauv.a(var5.getFunction(), var13, var12, var9);
      }
   }

   private void a(zaux var1, PivotFieldCollection var2, int var3) {
      PivotField var4 = var2.get(var3);
      int var5 = var4.getAutoShowField();
      if (var5 < this.q && var5 >= 0) {
         PivotField var6 = this.a.getDataFields().get(var5);
         zauo var7 = new zauo(true, var4.isAscendSort());
         int var8 = var1.d.size();

         for(int var9 = 0; var9 < var8; ++var9) {
            zaux var10 = (zaux)var1.d.get(var9);
            Object var11 = this.a(var10.a, (PivotItem)null, var10.c, true, var6, var9, (zbrd)null);
            var11 = this.a(var11);
            var7.a(var11, var9);
         }

         int[] var15 = var7.a();
         ArrayList var13 = new ArrayList();
         int var14 = var15.length;

         for(int var12 = 0; var12 < var14; ++var12) {
            com.aspose.cells.b.a.a.ze.a(var13, var1.d.get(var15[var12]));
         }

         var1.d = var13;
      }
   }

   private boolean a(PivotFieldCollection var1) {
      if (var1.getCount() > 1) {
         PivotField var2 = var1.get(var1.getCount() - 1);
         if (this.q > 1 && var2 == this.a.getDataField()) {
            return false;
         } else if (var2.getSubtotals(1)) {
            return false;
         } else {
            return !var2.getSubtotals(0);
         }
      } else {
         return false;
      }
   }

   private void a(Cell var1) {
      if (var1 != null) {
         Style var2 = this.a.ac.a(this.a.ad[var1.getRow() - this.a.i][var1.getColumn() - this.a.k]);
         Style var3 = var1.getStyle();
         if (var3.isModified(24) && var3.j()) {
            var2.setCustom(var3.getCustom());
            var2.d(var3.getNumber());
         }

         var1.a(var2);
      }
   }

   private void a(Cell var1, int var2, int var3) {
      if (var1 != null) {
         Style var4 = this.a.ac.a(this.a.ae[var2][var3]);
         Style var5 = var1.getStyle();
         if (var5.isModified(24) && var5.j()) {
            var4.setCustom(var5.getCustom());
            var4.d(var5.getNumber());
         }

         var1.a(var4);
      }
   }
}
